--0016364273adb521be0495d12244
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Nov 24, 2010 at 12:20 PM, Phillip Gawlowski <
cmdjackryan / googlemail.com> wrote:

>
> > Maths and computation are not the same thing. Is there anything in the
> > above which applies only to Ruby and not to floating point computation
> > in another other mainstream programming language?
>
> You conveniently left out that Ruby thinks dividing by 0.0 results in
> infinity.
> That's not just wrong, but absurd to the extreme.


Its wrongness is an interpretation (I would also prefer that it just break,
but I can certainly see why some would say it should be infinity). And it
doesn't apply only to Ruby:

Java:
public class Infinity {
  public static void main(String[] args) {
    System.out.println(1.0/0.0); // prints "Infinity"
  }
}

JavaScript:
document.write(1.0/0.0) // prints "Infinity"

C:
#include <stdio.h>
int main( ) {
  printf( "%f\n" , 1.0/0.0 ); // prints "inf"
  return 0;
}

--0016364273adb521be0495d12244--