issue with inf from exp function
Matt Gamble
gamblemj at gmail.com
Wed Mar 7 16:06:26 UTC 2018
On Wednesday, 7 March 2018 at 16:00:39 UTC, Alex wrote:
> On Wednesday, 7 March 2018 at 15:44:28 UTC, Matt Gamble wrote:
>> I don't understand why I'm getting an 'inf' by raising E to a
>> real number, e^^710.0L. See below.
>>
>> 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
>>
>> writefln("ln(largest real) = %s", log(real.max)); // 11356.6
>> real t = 710.0;
>> writefln("e^710 = %s", exp(t)); //why is this inf???
>> }
>>
>> Any help would be greatly appreciated. I have functions in an
>> actual program that are giving me a headache due to this issue.
>
> works for me as expected.
>
> ln(largest double) = 709.783
> e^710 = inf
> ln(largest real) = 11356.5
> e^710 = 2.23399e+308
Really? Is it my system?
I'm running windows 10, with an intel Core i7-4650, 64bit
operating system
I compiled with -m64 -g -unittest -main
More information about the Digitalmars-d-learn
mailing list