Infinity -- Float 
Author Message
 Infinity -- Float

It seems that Ruby has a concept of infinity:

Quote:
>> 1.0/0
=> Infinity
>> (1.0/0).class

=> Float

I wish to return this value, but I can't quite figure out what Ruby's
symbol for Infinity is.  I guess that I could write:

my_method
    ...
    return 1.0/0
end

But I'd rather do something like

my_method
    ...
    return Infinity
end

(Replace "Infinity" by the appropriate value).

Does anyone know what symbol Ruby uses for "Infinity"?

--
Daniel Carrera
Graduate Teaching Assistant.  Math Dept.
University of Maryland.  (301) 405-5137



Sat, 06 Aug 2005 09:51:47 GMT  
 Infinity -- Float

Quote:

> It seems that Ruby has a concept of infinity:

> >> 1.0/0
> => Infinity
> >> (1.0/0).class
> => Float

> I wish to return this value, but I can't quite figure out what Ruby's
> symbol for Infinity is.  I guess that I could write:

> my_method
>     ...
>     return 1.0/0
> end

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/61840

--
 _           _                            
| |__   __ _| |_ ___ _ __ ___   __ _ _ __  
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
        Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

..Deep Hack Mode -- that mysterious and frightening state of
consciousness where Mortal Users fear to tread.
        -- Matt Welsh



Sat, 06 Aug 2005 15:45:42 GMT  
 Infinity -- Float
Thanks.

Quote:


> > It seems that Ruby has a concept of infinity:

> > >> 1.0/0
> > => Infinity
> > >> (1.0/0).class
> > => Float

> > I wish to return this value, but I can't quite figure out what Ruby's
> > symbol for Infinity is.  I guess that I could write:

> > my_method
> >     ...
> >     return 1.0/0
> > end

> http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/61840

> --
>  _           _                            
> | |__   __ _| |_ ___ _ __ ___   __ _ _ __  
> | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
> | |_) | (_| | |_\__ \ | | | | | (_| | | | |
> |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
>    Running Debian GNU/Linux Sid (unstable)
> batsman dot geo at yahoo dot com

> ...Deep Hack Mode -- that mysterious and frightening state of
> consciousness where Mortal Users fear to tread.
>    -- Matt Welsh

--
Daniel Carrera
Graduate Teaching Assistant.  Math Dept.
University of Maryland.  (301) 405-5137


Sun, 07 Aug 2005 04:54:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Floating point types and infinity closure info needed

2. Float class with infinity and stuff, interval computations

3. 30 clocks sin/cos radians or degrees,foating point above -infinity to under infinity @ almost 6 significant digits

4. Representation of infinity in J v6.1 change on the VAX ULTRIX

5. MLM Paying Infinity Deep!!

6. MLM Paying Infinity Deep!

7. +-Infinity

8. Infinity and Metanumbers

9. Help with rounding errors and infinity.

10. LOGO-L> Infinity and like words

11. LOGO-L> Infinity and like words

12. D-infinity

 

 
Powered by phpBB® Forum Software