January 13, 2006 assert() doesn't convert floating point literals of mixed type correctly | ||||
---|---|---|---|---|
| ||||
AFAICT, it only applies to assert(). Even static assert() works correctly. void main() { bool q = (0.9 + 3.5L == 0.9L + 3.5L); assert(q); //ok static assert(0.9 + 3.5L == 0.9L + 3.5L); //ok assert(0.9 + 3.5L == 0.9L + 3.5L); // fails! } |
January 15, 2006 Re: assert() doesn't convert floating point literals of mixed type correctly | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don Clugston Attachments: | Don Clugston schrieb am 2006-01-13: > AFAICT, it only applies to assert(). > Even static assert() works correctly. > > void main() > { > bool q = (0.9 + 3.5L == 0.9L + 3.5L); > assert(q); //ok > static assert(0.9 + 3.5L == 0.9L + 3.5L); //ok > assert(0.9 + 3.5L == 0.9L + 3.5L); // fails! > } Added to DStress as http://dstress.kuehne.cn/run/a/assert_12_A.d http://dstress.kuehne.cn/run/a/assert_12_B.d http://dstress.kuehne.cn/run/a/assert_12_C.d Thomas |
Copyright © 1999-2021 by the D Language Foundation