> As I stated in [ruby-core:27631], I don't object about having two
> string representation, one "human readable" and the other "more
> verbose". =A0Even though I am not fully against, it doesn't mean, I
> enjoy having two representation. =A0Float is float is float. =A0We should
> know about error when you treat with float, shouldn't we?

Agreed that we should (and 1.9.1 does not).

For me, I think having two might be useful.  Most people who write
simple scripts, like

print 2.1-0.9

probably want to output a humanized version by default, or at least
have one available.  Similarly for "float #{f}" et al.

Somebody debugging code would want to be able to easily look closer,
which 1.9.2 currently provides:

>> a =3D 1.1 - 0.9
0.20000000000000007
>> b - 0.2
0.2
>> a =3D=3D b
=3D> false

> Anyway, I feel like we still have two points:
>
> (1) We've got consensus which method to behave which so far. =A0Since
> =A0 =A0#inspect is a method for "human readable" string representation,
> =A0 =A0I think it is more suitable to get "human readable" float
> =A0 =A0representation. =A0Others want to #to_s to be "human readable" to
> =A0 =A0ease "Float #{f}".

From my perspective, to inspect means a "closer inspection" (i.e. more
verbose output than to_s [1]).

(Also, changing inspect instead of to_s would keep better backward
compatibility, which might help people not get mad.)

> (2) Besides that, I am not sure whether the old behavior is the best
> =A0 =A0way to generate "human readable" representation.

Agreed.

I do like the option Benoit proposed: (add a parameter, like
f.to_s(2))  Then users are forced to realize that they are rounding,
there is nothing implicit.  This would be my preference (current
behavior, but add parameter to to_s)

Another option might be to use "%g" instead of  "%.15g" ex:

>>  "%#.15g" % (1.4 - 0.1 - 1.2)
=3D> "0.0999999999999999" # current way for 1.9.1
>  "%#g" % (1.4 - 0.1 - 1.2)
=3D> "0.100000"

Anybody know why that 15 is in there?

Much thanks.

-roger
[1] http://www.google.com/dictionary?aq=3Df&langpair=3Den%7Cen&hl=3Den&q=3D=
inspect