[xquery-talk] Literal NaN

Andrew Welch andrew.j.welch at gmail.com
Mon Feb 28 15:43:12 PST 2011


2011/2/28 David Lee <dlee at calldei.com>:
> Micheal Kay says →
>
> You can construct it using xs:double('NaN') or xs:float('NaN')
> =========================
>
> But you still can’t compare it to another NaN (and get true).
> So what is the ‘best’ way to determine if a numeric is a NaN ?
> So far I’ve only found
>       xs:string(value) eq ‘NaN’
>
>       Ok this works, but I’d still vote for a
>
>        fn:isNaN()


not(boolean(number($num)))   ?


-- 
Andrew Welch
http://andrewjwelch.com



More information about the talk mailing list