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;

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

it works for me too.


Reply via email to