floating-WTF
sclytrack
sclytrack at fake.com
Tue Jan 24 02:01:29 PST 2012
---------------------------------------
alias float Real;
Real lerp(Real t, Real a, Real b)
{
Real s2 = t * b;
writeln("t*b= ", s2);
writeln("t*b= ", t * b);
return s2;
}
Output:
t*b= 1.5
t*b= 1.5
-------------------------------------
alias float Real;
Real lerp(Real t, Real a, Real b)
{
Real s1 = (1.0 - t) * a;
Real s2 = t * b;
writeln("t*b= ", s2);
writeln("t*b= ", t * b);
return s2;
}
Output:
t*b= 0
t*b= 1.5
-------------------------------------
>>
>>> I presume this is another DMD bug?
>>
>
yes.
More information about the Digitalmars-d-learn
mailing list