From: Robert Klemme Date: 2005-09-02T19:21:25+09:00 Subject: Re: float out of range lovebyte2000@gmail.com wrote: > Hi, > > I am reading from a file a list of floating point numbers, some of > which are high precision. When I read such a number, I get a float > out of range warning: > > % ff = Kernel.Float("1.0e-309") > % puts ff > > test.rb:3: warning: Float 1.0e-309 out of range > 0.0 > > The number is converted to 0.0 which is fine, but I would like to get > rid of this warning within the code. > > Could anyone tell me how? Sorry if this is trivial, I am new to ruby, > and I haven't found a solution on the net (-W0 is not what I am > looking for). IMHO Float() should raise an exception in these cases; your program will never be aware of the conversion error and thus cannot take any action against this. Although this might break some code I'd strongly advocate to put an exception in there. Unfortunaltely this won't help you right now... Kind regards robert