[Issue 2697] Cast of float function return to ulong or uint gives bogus value
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun May 3 11:30:47 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2697
moritzwarning at web.de changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |moritzwarning at web.de
------- Comment #2 from moritzwarning at web.de 2009-05-03 13:30 -------
I only see this error on windows, linux (x64) works for me. (dmd 1.043)
This is the test case I have made after I ran into this problem:
float getFloat() {
return 11468.78f;
}
void main() {
uint i = cast(uint) 11468.78f;
assert(i == 11468);
uint j = cast(uint) getFloat();
assert(j == 11468); //fails on windows: j is 0.
}
--
More information about the Digitalmars-d-bugs
mailing list