"nan" v. try-catch for arithmetic
jhj at jhj.com
Wed Jun 25 00:06:35 CEST 2014
On Jun 24, 2014, at 11:02 AM, Graham Samuel <livfoss at mac.com> wrote:
> If I put
> that fires too. But if I put
> I get a result, "nan", and the catch doesn't fire. Why not?
Gee, you'd expect sqrt(-1) and (-1)^(1/2) to evaluate the same. Apparently, the sqrt function checks the parameter to be non-negative, like it says in the dictionary. That would be a lot harder to do in a generalized arithmetic expression.
More information about the use-livecode