From: Caleb Clausen Date: 2006-07-23T08:40:43+09:00 Subject: Re: Infinity On 7/22/06, Marcel Molina Jr. wrote: > Infinity = 1.0/0 > > (N.B. Doesn't work on all platforms.) Does anyone know a definition for Infinity that does work on all platforms? Here's what I use; I have no idea how robust it really is: Infinity= begin result= [ Float::MAX**Float::MAX, Float::MAX**2, Float::MAX*2].max result.infinite? ? result : result=1.0/0 rescue: Float::MAX #maybe 1.0/0 doesn't work on some systems? end unless defined? Infinity #there's also this way: 999999999999999999999999999999999999999999999999e99999999999999999 #but stuff like that sometimes returns zero, so it doesn't seem as reliable. #(plus it generates a warning)