March 30, 2011 [phobos] master phobos brunch, weird bug | ||||
---|---|---|---|---|
| ||||
I just forked latest phobos and cloned druntime to my dmd 2.052 distro
(I specifically obliterated the old sources) then rebuilt the whole
package, and stumbled on a _very strange_ issue when running unittest,
the vanilla output:
unittest
core.exception.AssertError at std.conv(2509): unittest failure
----------------
core.exception.AssertError at std\json.d(459): 1223 should be 1.223e+24
----------------
...
Closer examination shows that this test fails:
f = to!float( "123e+2" );
assert( f == 123e+2f ); //replacing with writeln shows... 123 WTF??!
And then mystery continues as placing writeln in one branch of parse
makes it work again!
(but fills screen with neat column of numbers)
At conv.d:1569
...
while (exp > 0)
{
while (exp >= pow)
{
ldval *= postab[u];
exp -= pow;
writeln(u); // <<<< here!
}
pow >>= 1;
u++;
}
...
I'm on Win7/64bit.
*Any* ideas? Can someone reproduce it? Auto-tester seems to run 32bit
Windows only.
--
Dmitry Olshansky
|
March 31, 2011 [phobos] master phobos brunch, weird bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dmitry Olshansky | Ok, I got this one sorted out - I should have built the latest dmd from git instead of using the one from the last release. > core.exception.AssertError at std.conv(2509): unittest failure > ---------------- > core.exception.AssertError at std\json.d(459): 1223 should be 1.223e+24 > ---------------- > ... > Closer examination shows that this test fails: > f = to!float( "123e+2" ); > assert( f == 123e+2f ); //replacing with writeln shows... 123 WTF??! > And then mystery continues as placing writeln in one branch of parse > makes it work again! > (but fills screen with neat column of numbers) > At conv.d:1569 > ... > while (exp > 0) > { > while (exp >= pow) > { > ldval *= postab[u]; > exp -= pow; > writeln(u); // <<<< here! > } > pow >>= 1; > u++; > } > ... -- Dmitry Olshansky |
Copyright © 1999-2021 by the D Language Foundation