[gambit-list] Integer infinity?

Marc Feeley feeley at iro.umontreal.ca
Thu Feb 21 15:03:10 EST 2008


On 21-Feb-08, at 2:41 PM, David St-Hilaire wrote:

> Hi gambit-list!
>
> I'd like to know how can I compare an exact number with the +/-  
> infinity value... I've found that there is +inf.0 available for  
> inexact numbers, but a simple (exact->inexact +inf.0) does not seem  
> to work :(.
>
> Thank you! ^_^


Well... infinity is an inexact real whose existence is due to the  
desire to conform to the IEEE 754 standard.  There is no "exact  
infinity".  But if all you want is to compare to infinity, just do it:

 > (define a 123)
 > (define b +inf.0)
 > (< a b)
#t
 > (< (expt 2 1000000) b)
#t

Marc




More information about the Gambit-list mailing list