[Grace-core] Detecting numeric faults

Michael Homer mwh at ecs.vuw.ac.nz
Wed Nov 5 10:47:01 PST 2014


On 6 Nov 2014 06:12, "Kim Bruce" <kim at cs.pomona.edu> wrote:
>
> How do we check for answers of the form NaN or infinity from results of
operations designed to return numbers.  For example "abc".asNumber returns
NaN, but Grace does not recognize this as an expression.  I don't see an
operation for checking this.  What am I missing?
>
Traditionally you use x != x to test for NaN. Infinities have ordinary
equality semantics so you can define constants.
-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20141106/fce69ef5/attachment.html>


More information about the Grace-core mailing list