At 03:42 PM 10/17/2001 -0500, David Nicol wrote:

>I am implementing a textbook algo in Perl (the textbook has
>it written in C++) and have realized that if undef was to
>numericize to NaN instead of 0, there are a lot of uninitialization
>errors that would get caught.

Yup, and it generically breaks:

   $foo{some_unused_key}++;

as well as some of the quick-n-dirty code that assumes numerified strings 
will be something rather than NaN, even if that something is 0.

Don't forget the rule that any math op with NaN in it ends up NaN. They 
tend to multiply pretty quickly.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to