[Issue 18570] New: exp function does not work correctly for real in 64bit
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Mar 7 17:08:44 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18570
Issue ID: 18570
Summary: exp function does not work correctly for real in 64bit
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: gamblemj at gmail.com
exp(real x) does not work when compiled under 64bit but does work under x86.
Others have confirmed this:
https://forum.dlang.org/post/xdssrjvcovxooweudkwn@forum.dlang.org
below is a simple example.
import std.stdio;
import std.math;
unittest
{
writefln("ln(largest double) = %s", log(double.max)); // 709.783
writefln("e^710 = %s", exp(710.0));// inf, makes sense perhaps
writefln("ln(largest real) = %s", log(real.max)); // 11356.6
real t = 710.0;
writefln("e^710 = %s", exp(t)); //inf in 64bit, 2.23399e+308 for 32bit
}
--
More information about the Digitalmars-d-bugs
mailing list