Testing for NaN in VBA/VB6 -
using vba loading 8-byte floating point number array of bytes double. numbers ieee 754 nan (i.e. if try print debug.print see 1.#qnan). question is, how can test whether data contained in double nan opposed regular number?
thanks.
nan's have pattern in exponent can identify while they're still in byte array. specifically, nan have exponent of 1's, infinity, should trap.
in double, exponent in highest-order 2 bytes:
seeeeeee eeeemmmm mmm....
assume b(0) , b(1):
is_a_nan = ((b(0) , &h7f) = &h7f) , ((b(1) , &hf0) = &hf0)
that's air code, idea.
if need distinguish between snan, qnan, , infinity you'll need deeper, doesn't sound that's issue you.
Comments
Post a Comment