[Issue 1681] cast(real) ulong.max == 0
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 21 12:23:53 PST 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1681
------- Comment #2 from andrei at metalanguage.com 2007-11-21 14:23 -------
(In reply to comment #1)
> Real is a floating point type, typically 80 bits. Ulong is a 64-bit
> integer type. Real is not capable of holding a value as large as
> ulong.max. That is why the assert fails.
Float must store integers with proper successors up to 2 ** 24 - 1. Double must
store integers with proper successors up to 2 ** 53 - 1. Real (i.e.
"double-extended") must store integers with proper successors up to at least 2
** 64 - 1. The program prints 0.
--
More information about the Digitalmars-d-bugs
mailing list