How to test if float is NaN?

Thomas Kuehne thomas-dloop at kuehne.cn
Tue May 16 20:36:34 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

clayasaurus schrieb am 2006-05-17:
> How do you test if float is Nan? == and is doesn't seem to work.

1)
#
# if(num !<>= 0.0){
#     // ...
# }

2)
# import std.math;
#
# if(isnan(num)){
#     // ...
# }

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFEaqeQ3w+/yD4P9tIRAk/1AJsHaMIYMVQ1GgjTg8Yn3afE8ilMfgCfb+15
BLGWcCiaGKR3GjBEeXtmZGg=
=w7vc
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-learn mailing list