From: George Neuner Date: 2010-05-08T09:40:12+09:00 Subject: Re: ruby 1.9+ , floats, and decimal On Mon, 19 Apr 2010 00:24:56 -0500, Christopher Dicely wrote: >On Sun, Apr 18, 2010 at 8:07 PM, botp wrote: > >>shouldn't it be time for ruby to default to "real" decimal instead >>of float? > >I think decimal floating point (as supported in the 2008 version of >IEEE 754) would be a good idea. The decimal formats in 754-2008 are *storage* formats only ... the math specification is still binary. >OTOH, to reduce the potential impact on existing code -- including >on performance, where binary floating point, since it has more >prevalent hardware support, is likely to outperform in most cases More prevalent than what? There is no commercial architecture that has a decimal FPU. Even integer BCD support is rare now. >-- it might be better to introduce a simple syntax for decimal >floating point literals, e.g. an integer or floating point expression >with a trailing (no intervening whitespace) "d" like 1.0d would be >treated as a decimal floating point value. Just adding syntax won't help - you'd need to automagically activate the BigDecimal class as well. George