digitalmars.D - could someone check this on another system?
- BCS (21/21) May 04 2009 The attached (er. Can't seem to attach the file, I'll e-mail it to anyon...
- Georg Wrede (5/32) May 04 2009 Prints
- BCS (3/34) May 04 2009 As I said, it's something like the above (but not exactly) and even mino...
- BCS (3/28) May 04 2009 I've posted the code here:
- Kagamin (5/9) May 05 2009 auto r = (rp == Point(-.5,1.5));
- BCS (27/38) May 05 2009 Yes that's the spot that was (is?) generating an error. I'm not so sure ...
- Nick Sabalausky (8/29) May 04 2009 Prepending the following to the above:
- BCS (3/11) May 04 2009 try the version that actuly has the bug:
- Nick Sabalausky (24/170) May 04 2009 Ok, WinXP 32-bit, and on both 1.040 and 1.041 (byte-for-byte identical
- BCS (9/16) May 04 2009 Hmm. IIRC my home box gave:
The attached (er. Can't seem to attach the file, I'll e-mail it to anyone who's willing to take a look) has a bug on WinXP DMD 1.040. I can't seem to reduce it at all as anything but trivial changes (like removing dead code) seems to make the bug vanish. The short description is I have some code that looks something like this: bool Foo() { bool ret = true; writef(ret,'\n'); return ret; } unittest { auto ret = Foo(); writef(ret,'\n'); assert(ret); } output: true false Assert Failed
May 04 2009
BCS wrote:The attached (er. Can't seem to attach the file, I'll e-mail it to anyone who's willing to take a look) has a bug on WinXP DMD 1.040. I can't seem to reduce it at all as anything but trivial changes (like removing dead code) seems to make the bug vanish. The short description is I have some code that looks something like this: bool Foo() { bool ret = true; writef(ret,'\n'); return ret; } unittest { auto ret = Foo(); writef(ret,'\n'); assert(ret); } output: true false Assert FailedPrints true true on Fedora-10, dmd v1.042
May 04 2009
Reply to Georg,BCS wrote:As I said, it's something like the above (but not exactly) and even minor changes make it vanish so it's no surprise that exact code works.The attached (er. Can't seem to attach the file, I'll e-mail it to anyone who's willing to take a look) has a bug on WinXP DMD 1.040. I can't seem to reduce it at all as anything but trivial changes (like removing dead code) seems to make the bug vanish. The short description is I have some code that looks something like this: bool Foo() { bool ret = true; writef(ret,'\n'); return ret; } unittest { auto ret = Foo(); writef(ret,'\n'); assert(ret); } output: true false Assert FailedPrints true true on Fedora-10, dmd v1.042
May 04 2009
Reply to Benjamin,The attached (er. Can't seem to attach the file, I'll e-mail it to anyone who's willing to take a look) has a bug on WinXP DMD 1.040. I can't seem to reduce it at all as anything but trivial changes (like removing dead code) seems to make the bug vanish. The short description is I have some code that looks something like this: bool Foo() { bool ret = true; writef(ret,'\n'); return ret; } unittest { auto ret = Foo(); writef(ret,'\n'); assert(ret); } output: true false Assert FailedI've posted the code here: http://smplsite.com/filebox/error.zip
May 04 2009
BCS Wrote:I've posted the code here: http://smplsite.com/filebox/error.zipauto r = (rp == Point(-.5,1.5)); writef("---%s\n", r); assert(r, "++"~rp.toString); Is this it?
May 05 2009
Reply to Kagamin,BCS Wrote:Yes that's the spot that was (is?) generating an error. I'm not so sure anymore as my system is no longer reproing but I seem to recall that it was printing out true inside the opEquals function but false outside. BTW the first function in that file had a bug and should be: //Usable AlmostEqual function bool ULP(T)(T A, T B, uint maxUlps) { if(A == B) return true; static if(is(T == float)) { alias int Tint; Tint bound = 0x8000_0000; } else static if(is(T == double)) { alias long Tint; Tint bound = 0x8000_0000_0000_0000; } else static assert(false, "only float or double can be used, not "~T.stringof); // Make sure maxUlps is non-negative and small enough that the // default NAN won't compare as equal to anything. assert(maxUlps > 0 && maxUlps < 4 * 1024 * 1024); auto aInt = *cast(Tint*)&A; // Make aInt lexicographically ordered as a twos-complement int if (aInt < 0) aInt = bound - aInt; // Make bInt lexicographically ordered as a twos-complement int auto bInt = *cast(Tint*)&B; if (bInt < 0) bInt = bound - bInt; auto ulp = abs(aInt - bInt); if (ulp <= maxUlps) return true; return false; }I've posted the code here: http://smplsite.com/filebox/error.zipauto r = (rp == Point(-.5,1.5)); writef("---%s\n", r); assert(r, "++"~rp.toString); Is this it?
May 05 2009
"BCS" <none anon.com> wrote in message news:a6268ff56558cb9ab074256fbe news.digitalmars.com...The attached (er. Can't seem to attach the file, I'll e-mail it to anyone who's willing to take a look) has a bug on WinXP DMD 1.040. I can't seem to reduce it at all as anything but trivial changes (like removing dead code) seems to make the bug vanish. The short description is I have some code that looks something like this: bool Foo() { bool ret = true; writef(ret,'\n'); return ret; } unittest { auto ret = Foo(); writef(ret,'\n'); assert(ret); } output: true false Assert FailedPrepending the following to the above: import std.stdio; void main() {} I got the following on WinXP 32-bit DMD 1.041: true true
May 04 2009
Reply to Nick,"BCS" <none anon.com> wrote in message news:a6268ff56558cb9ab074256fbe news.digitalmars.com...try the version that actuly has the bug: http://smplsite.com/filebox/error.zipThe attached (er. Can't seem to attach the file, I'll e-mail it to anyone who's willing to take a look)I got the following on WinXP 32-bit DMD 1.041: true true
May 04 2009
"BCS" <ao pathlink.com> wrote in message news:78ccfa2d3f7098cb9acac6a471c6 news.digitalmars.com...Reply to Nick,Ok, WinXP 32-bit, and on both 1.040 and 1.041 (byte-for-byte identical output on both), my output from go.bat was: ---------------------- D:\DevProject\Test\D\NewsgroupRequest\error>del *.obj D:\DevProject\Test\D\NewsgroupRequest\error>dmd -c -unittest -Icairod by_loop.d [<%lg,%lg>|<%lg,%lg>] D:\DevProject\Test\D\NewsgroupRequest\error>dmd -c -unittest -Icairod output.d [<%lg,%lg>|<%lg,%lg>] D:\DevProject\Test\D\NewsgroupRequest\error>dmd -c -unittest -Icairod graph.d [<%lg,%lg>|<%lg,%lg>] D:\DevProject\Test\D\NewsgroupRequest\error>dmd -c -unittest -Icairod geom.d [<%lg,%lg>|<%lg,%lg>] D:\DevProject\Test\D\NewsgroupRequest\error>dmd -c -unittest -Icairod utmain.d D:\DevProject\Test\D\NewsgroupRequest\error>dmd utmain.obj by_loop.obj output.obj graph.obj geom.obj cairo.lib D:\DevProject\Test\D\NewsgroupRequest\error>utmain"BCS" <none anon.com> wrote in message news:a6268ff56558cb9ab074256fbe news.digitalmars.com...try the version that actuly has the bug: http://smplsite.com/filebox/error.zipThe attached (er. Can't seem to attach the file, I'll e-mail it to anyone who's willing to take a look)I got the following on WinXP 32-bit DMD 1.041: true true---truetrue false true true true true true true false false false false false false false false false false false false false false false false false false false false false false false false false false false false true true false false false false false false false false false false false false true true false false false false false false false false false false false false false false false false false false false false false true true----------------------false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false false true true false false false false true false false false false true false false false false true false false false false true
May 04 2009
Reply to Nick,Ok, WinXP 32-bit, and on both 1.040 and 1.041 (byte-for-byte identical output on both), my output from go.bat was:...Hmm. IIRC my home box gave:---truetrue--- false but I just ran it on my work boxes and got:true--- false I'll have to recheck the home machine. With a bit more digging it seems that right now I'm getting an almost equal error that writef was hiding by rounding. I've already got a fuzzy equal so I guess I just need to do some tuning.false
May 04 2009