Operations on Inf/NaN

Paul C. Anagnostopoulos paul at windfall.com
Thu Sep 16 17:38:06 UTC 2010


At 9/16/2010 01:15 PM, Andrew Whitworth wrote:
>I personally don't like the idea of ever leaving anything undefined.
>The C language is at a disadvantage because it was created so many
>years ago and because it's designed to run on so many different
>platforms.
>
>Parrot doesn't really have either of those problems. Parrot is a
>single standard platform, and we really don't need to be leaving
>values undefined anywhere. We really have three possible behaviors:
>
>1) leave things undefined, which I think is bad
>2) Force some kind of integer conversion (INF -> INT_MAX, NAN -> 0, etc)
>3) Throw an exception.
>
>I lean towards the third option. If somebody attempts an operation
>that is so clearly not a normal operation, we should proactively
>notify them about it, not silently do something strange and
>non-intuitive.

I agree that if we don't go with (1), we should go with (3).

~~ Paul


----------------------------------------------------------------
Windfall               Paul C. Anagnostopoulos 
      ----------------------------------------------------------
   Software             978 371-2316 
                             www.windfall.com
----------------------------------------------------------------
Metaphorical invocations ... often suffer from the
weakness of giving such satisfaction to the human
mind that they tend to be mistaken for incisive and
illuminating observations. ---Torkel Franzen 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.parrot.org/pipermail/parrot-dev/attachments/20100916/ac0b6393/attachment.html>


More information about the parrot-dev mailing list