[#964] Bastion or SecurityManager for Ruby? — Clemens Hintze <clemens.hintze@...>

Hi,

15 messages 1999/12/10

[#989] a question about to_i — Friedrich Dominicus <Friedrich.Dominicus@...>

Sorry, I'm quite new to ruby. But I encounterd the following problem. If

17 messages 1999/12/19

[ruby-talk:01022] Re: a question about to_i

From: matz@... (Yukihiro Matsumoto)
Date: 1999-12-31 16:19:15 UTC
List: ruby-talk #1022
Hi,

In message "[ruby-talk:01015] Re: a question about to_i"
    on 99/12/31, Clemens Hintze <c.hintze@gmx.net> writes:

|If I use Integer, Float, String, ... I would raise an exception, if
|the result of the conversion couldn't converted back to the original
|object.

This principle is interesting, but I'm afraid it is difficult for
Float because of precision.  Because floating point numbers are
represented in binaries, not in decimals on most platforms, the float
value from the integer 12 is sometimes 11.999... or something else.

And what do you think about this case?

   s = "1.3e10"; f = Float(s)   # hmm? Integer(f) != s

|IMHO the '.to_x' methods could remain as they are!

Thank you for your opinion.  These opinions help me much.

 							matz.

In This Thread