On Jan 9, 2009, at 4:22 PM, Gary Wright wrote: > > On Jan 9, 2009, at 3:51 PM, Raphael Clancy wrote: > >> I was playing around with the basic math functions, and I had some >> questions about the way Ruby handles operations with 0 and 0.0. > > I'm guessing that you are seeing IEEE floating point behavior with > the floating point operations and that there isn't a perfect analog > to that behavior with integer operations. IEEE floating > point defines binary representations of negative and positive zero, > negative and positive infinity, and two types of NaN (not a number). > These 'numbers' aren't available when working with integers at the > machine level nor at the Ruby Fixnum or Bignum level. > > Gary Wright In particular, look at how IEEE defines operations such as 0.0/0.0 http://steve.hollasch.net/cgindex/coding/ieeefloat.html -Rob Rob Biedenharn http://agileconsultingllc.com Rob / AgileConsultingLLC.com