fp-qnan? ( x -- ? )
Factor documentation > Factor handbook > The language > Numbers > Floats > Bitwise operations on floats
Prev:fp-nan? ( x -- ? )
Next:fp-snan? ( x -- ? )


Vocabulary
math

Inputs and outputs
xa real
?a boolean


Word description
Tests if x is an IEEE Quiet Not-a-Number value. While x can be any real number, this word will only ever yield true if x is a float.

See also
fp-special?, fp-nan?, fp-snan?, fp-infinity?, fp-nan-payload, <fp-nan>

Definition
IN: math

GENERIC: fp-qnan? ( x -- ? )


Methods
USING: kernel math ;

M: float fp-qnan?
dup fp-nan?
[ fp-nan-payload 51 2^ bitand zero? not ] [ drop f ] if ;
inline


USING: kernel math ;

M: object fp-qnan? drop f ; inline