digitalmars.D.bugs - Negative numbers are treated as Positive in compares.
- David L. Davis (31/31) Aug 10 2005 // WinXP with D v0.129 (and v0.128)
- Jarrett Billingsley (3/10) Aug 10 2005 Oh dear. Confirmed 0.129 Windows.
- =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= (16/45) Aug 13 2005 -----BEGIN PGP SIGNED MESSAGE-----
// WinXP with D v0.129 (and v0.128) At first, I couldn't understand why my D code was falling into areas of code it shouldn't have...until I discovered that the negative numbers were being treated as if they were positive numbers in my compares. As the example below shows: Output: -------- C:\dmd>dmd negcompare.d C:\dmd\bin\..\..\dm\bin\link.exe negcompare,,,user32+kernel32/noi; C:\dmd>negcompare main() : (-128 >= 0)=true, (-128 <= 0)=false main() : (128 >= 0)=true, (128 <= 0)=false C:\dmd> David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Aug 10 2005
"David L. Davis" <SpottedTiger yahoo.com> wrote in message news:dddcir$ds4$1 digitaldaemon.com...// WinXP with D v0.129 (and v0.128) At first, I couldn't understand why my D code was falling into areas of code it shouldn't have...until I discovered that the negative numbers were being treated as if they were positive numbers in my compares. As the example below shows:Oh dear. Confirmed 0.129 Windows.
Aug 10 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David L. Davis schrieb:// WinXP with D v0.129 (and v0.128) At first, I couldn't understand why my D code was falling into areas of code it shouldn't have...until I discovered that the negative numbers were being treated as if they were positive numbers in my compares. As the example below shows: Output: -------- C:\dmd>dmd negcompare.d C:\dmd\bin\..\..\dm\bin\link.exe negcompare,,,user32+kernel32/noi; C:\dmd>negcompare main() : (-128 >= 0)=true, (-128 <= 0)=false main() : (128 >= 0)=true, (128 <= 0)=falseAdded to DStress as http://dstress.kuehne.cn/run/o/opCmp_05_A.d http://dstress.kuehne.cn/run/o/opCmp_05_B.d http://dstress.kuehne.cn/run/o/opCmp_05_C.d http://dstress.kuehne.cn/run/o/opCmp_05_D.d http://dstress.kuehne.cn/run/o/opCmp_05_E.d http://dstress.kuehne.cn/run/o/opCmp_05_F.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFC/l773w+/yD4P9tIRAiQuAJ4s5Az4o9REpHemYIuCONAE3ueKlwCfXA6l MXuOL35ZbJgsgziMxhbNZo8= =x4tp -----END PGP SIGNATURE-----
Aug 13 2005