digitalmars.D.bugs - Large integer division
- Deewiant (9/9) Dec 06 2005 Dividing really big ulongs by each other doesn't seem to work at all.
- Kris (3/12) Dec 06 2005 Confirmed: _ULDIV appears to be faulty.
- Dave (2/17) Dec 06 2005 There looks to be a problem with longs as well (__LDIV__).
- =?ISO-8859-15?Q?Anders_F_Bj=F6rklund?= (18/30) Dec 07 2005 FWIW, Both "long" and "ulong" works fine with GDC
-
=?ISO-8859-15?Q?Anders_F_Bj=F6rklund?=
(2/5)
Dec 07 2005
-42 - Walter Bright (3/4) Dec 08 2005 Criminy! You're right. I have it fixed, it'll go out in the next update.
- Thomas Kuehne (18/27) Dec 09 2005 -----BEGIN PGP SIGNED MESSAGE-----
Dividing really big ulongs by each other doesn't seem to work at all. --- void main() { ulong a = 10_000_000_000_000_000, b = 1_000_000_000_000_000; assert (a / b == 10); } --- a / b is, according to writef, 9223372036854775818.
Dec 06 2005
Confirmed: _ULDIV appears to be faulty. "Deewiant" <deewiant.doesnotlike.spam gmail.com> wrote in message news:dn3old$hhr$1 digitaldaemon.com...Dividing really big ulongs by each other doesn't seem to work at all. --- void main() { ulong a = 10_000_000_000_000_000, b = 1_000_000_000_000_000; assert (a / b == 10); } --- a / b is, according to writef, 9223372036854775818.
Dec 06 2005
In article <dn4l2u$1joa$1 digitaldaemon.com>, Kris says...Confirmed: _ULDIV appears to be faulty. "Deewiant" <deewiant.doesnotlike.spam gmail.com> wrote in message news:dn3old$hhr$1 digitaldaemon.com...There looks to be a problem with longs as well (__LDIV__).Dividing really big ulongs by each other doesn't seem to work at all. --- void main() { ulong a = 10_000_000_000_000_000, b = 1_000_000_000_000_000; assert (a / b == 10); } --- a / b is, according to writef, 9223372036854775818.
Dec 06 2005
Deewiant wrote:Dividing really big ulongs by each other doesn't seem to work at all. --- void main() { ulong a = 10_000_000_000_000_000, b = 1_000_000_000_000_000; assert (a / b == 10); } --- a / b is, according to writef, 9223372036854775818.FWIW, Both "long" and "ulong" works fine with GDC import std.stdio; int main() { ulong a = 10_000_000_000_000_000, b = 1_000_000_000_000_000; assert (a / b == 10); debug writefln(a / b); long c = -42_000_000_000_000_000, d = 1_000_000_000_000_000; assert (c / d == -42); debug writefln(c / d); return 0; } prints: 10 42 --anders
Dec 07 2005
prints: 10 42<duh> -42 --anders
Dec 07 2005
"Deewiant" <deewiant.doesnotlike.spam gmail.com> wrote in message news:dn3old$hhr$1 digitaldaemon.com...Dividing really big ulongs by each other doesn't seem to work at all.Criminy! You're right. I have it fixed, it'll go out in the next update.
Dec 08 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Deewiant schrieb am 2005-12-06:Dividing really big ulongs by each other doesn't seem to work at all. --- void main() { ulong a = 10_000_000_000_000_000, b = 1_000_000_000_000_000; assert (a / b == 10); } --- a / b is, according to writef, 9223372036854775818.Added to DStress as http://dstress.kuehne.cn/run/o/opDiv_13_A1.d http://dstress.kuehne.cn/run/o/opDiv_13_A2.d http://dstress.kuehne.cn/run/o/opDiv_13_B1.d http://dstress.kuehne.cn/run/o/opDiv_13_B2.d http://dstress.kuehne.cn/run/o/opDiv_13_C1.d http://dstress.kuehne.cn/run/o/opDiv_13_C2.d http://dstress.kuehne.cn/run/o/opDiv_13_D1.d http://dstress.kuehne.cn/run/o/opDiv_13_D2.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDmlgE3w+/yD4P9tIRAjmDAJ44kwQO0J1E8V2rPCbUHjUpKa/3kQCgz2cc GW1Cne6oEZg5maUsuSEt8WU= =gB7+ -----END PGP SIGNATURE-----
Dec 09 2005