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! ^_^
David
Afficher les réponses par date
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