From: botp Date: 2010-05-12T09:05:31+09:00 Subject: Re: ruby 1.9+ , floats, and decimal On Wed, May 12, 2010 at 12:05 AM, Rick DeNatale wrote: > Neither floats (regardless of base) nor rationals can represent all > real numbers.  Each pair of consecutive float values has an infinite > number of reals which fall in the crack between them.  Neither can > exactly represent irrational values including Pi, e, sqrt(2) etc. etc. i hope you are not exaggerating ;-) everyone knows that pi or e or sqt(2) or 1/3 cannot be express exactly in decimal form. the problem w current float representation is that they balk in plain and simple addition and subtraction operation :( can we not just fix that at least ? > For general purpose languages, a combination of integers (possibly > including arbitrary length integers as in Ruby/Smalltalk, etc) and > binary floats is probably the best choice for 'default' > representations, along with giving the programmer to choose > alternative representations for particular uses based on informed > trade-offs. agree totally. > -- > Rick DeNatale kind regards -botp