From: Tim Hunter Date: 2009-07-27T01:26:58+09:00 Subject: Re: Possible bug in rb_float_new() ??? Francisco Tufr� wrote: > Hi, when writing the ruby bindings for libsndfile i had a problem with > float numbers. > I have abstracted the important code and i put it right here, is > something i'm doind not right or a bug? > You can check the code at: http://pastebin.com/m6c5f3ed1 This has been discussed quite a bit lately. Just as there are fractions for which no exact decimal representation exists (1/3, for example), there are decimal floating-point numbers for which no exact binary representation exists. In an earlier thread on this topic, Chris Hulan said "Have a look at "What Every Computer Scientist Should Know About Floating-Point Arithmetic" (http://docs.sun.com/source/806-3568/ncg_goldberg.html)" -- MagickWand for Ruby - http://magickwand.rubyforge.org/