HP Forums

Full Version: Not a Number NaN
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

Is it posible to give back in a subroutine the expression (value?) NaN



In PPL, in theory, no.

The only way to generate a NaN on Prime is through the CAS. So you could generate a NaN using the CAS, store that in a variable (CAS or home) and then return that variable from your function.
Be careful of the difference between undef and NaN... undef IS NaN in CAS, but if moved to home, it becomes just a 'variable name'. Which means that it will NOT behave in the same way if you start doing calculations with it.

You want to make sure that, even in home, NaN+1=NaN (for example).

They might be some other way to do it, but this is the first one the jumps to mind.

Reference URL's