issue with inf from exp function

Matt Gamble gamblemj at gmail.com
Wed Mar 7 15:44:28 UTC 2018


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.


More information about the Digitalmars-d-learn mailing list