On Tuesday, 29 October 2019 at 16:11:45 UTC, Daniel Kozak wrote:
On Tue, Oct 29, 2019 at 5:09 PM Daniel Kozak
wrote:
If you use gdc or ldc you will get same results as c++, or you
can use C log directly:
import std.stdio;
import std.math : pow;
import core.stdc.math;
void main()
{
writefln("%12.3F",log(1-0.)/log(1-(1-0.6)^^20));
}
AFAIK dmd use real for floating point operations instead of
double
Thanks for the clarification. It appears then that because of
dmd's real calculations, it produces more accurate results, but
maybe slower. (Calculating the result with the high precision
calculator at https://keisan.casio.com/calculator agrees with
dmd.)