May 04, 2005 Compile-time floating point division | ||||
---|---|---|---|---|
| ||||
The following code fails for on Linux, but not Windows. Probable cause: DMD's complex_t::operator/ does not handle special cases as in Phobos/DMC/GNU runtime libraries. ----------- import std.math; double f = -1.0/0.0; double f1 = -1.0; double f2 = 0; int main() { assert(isinf(f1/f2)); // passes assert(isinf(f)); // fails return 0; } ---------- David |
May 11, 2005 Re: Compile-time floating point division | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Friedman | -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Friedman schrieb am Tue, 03 May 2005 20:39:02 -0400: > The following code fails for on Linux, but not Windows. Probable cause: DMD's complex_t::operator/ does not handle special cases as in Phobos/DMC/GNU runtime libraries. > > ----------- > import std.math; > double f = -1.0/0.0; > double f1 = -1.0; > double f2 = 0; > int main() { > assert(isinf(f1/f2)); // passes > assert(isinf(f)); // fails > return 0; > } > ---------- > > David Added to DStress as http://dstress.kuehne.cn/run/o/opDiv_07_A.d http://dstress.kuehne.cn/run/o/opDiv_07_B.d http://dstress.kuehne.cn/run/o/opDiv_08_A.d http://dstress.kuehne.cn/run/o/opDiv_08_B.d http://dstress.kuehne.cn/run/o/opDiv_09_A.d http://dstress.kuehne.cn/run/o/opDiv_09_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCglm83w+/yD4P9tIRAo2/AJ9z40wVKHx1LfxhvrYwLyHYcVohUQCdFosB cwjvIlUaq6h/0qQ4e3vlgIk= =d2OR -----END PGP SIGNATURE----- |
Copyright © 1999-2021 by the D Language Foundation