Equivalent to Java's Float.MAX_VALUE?

Hi all,

Does Ruby have an equivalent to Java’s Float.MIN_VALUE and
Float.MAX_VALUE (the smallest and largest finite numbers representable
respectively)? The pickaxe book doesn’t mention anything as such but
perhaps it has been added in newer Ruby versions.

Thanks in advance,
Farrel Lifson

···

Data Network Architecture Research Lab mailto:flifson@cs.uct.ac.za
Dept. of Computer Science http://people.cs.uct.ac.za/~flifson
University of Cape Town +27-21-650-3127

Float INFINITY = 1.0 / 0.0

Since floats do grow arbitrarily there is no other bound as system memory.

robert

“Farrel Lifson” flifson@cs.uct.ac.za schrieb im Newsbeitrag
news:1044884446.23956.4.camel@asgard.cs.uct.ac.za…

Hi all,

Does Ruby have an equivalent to Java’s Float.MIN_VALUE and
Float.MAX_VALUE (the smallest and largest finite numbers representable
respectively)? The pickaxe book doesn’t mention anything as such but
perhaps it has been added in newer Ruby versions.

Thanks in advance,
Farrel Lifson

Data Network Architecture Research Lab mailto:flifson@cs.uct.ac.za
Dept. of Computer Science
http://people.cs.uct.ac.za/~flifson

···

University of Cape Town +27-21-650-3127

Hi,

···

In message “Equivalent to Java’s Float.MAX_VALUE?” on 03/02/10, Farrel Lifson flifson@cs.uct.ac.za writes:

Does Ruby have an equivalent to Java’s Float.MIN_VALUE and
Float.MAX_VALUE (the smallest and largest finite numbers representable
respectively)? The pickaxe book doesn’t mention anything as such but
perhaps it has been added in newer Ruby versions.

Float::MAX in 1.8.0

						matz.

Hi,

Does Ruby have an equivalent to Java’s Float.MIN_VALUE and
Float.MAX_VALUE (the smallest and largest finite numbers representable
respectively)? The pickaxe book doesn’t mention anything as such but
perhaps it has been added in newer Ruby versions.

Float::MIN and Float::MAX have been added in 1.8.

···

At Mon, 10 Feb 2003 22:37:47 +0900, Farrel Lifson wrote:

At Mon, 10 Feb 2003 22:54:06 +0900, Robert Klemme wrote:

Since floats do grow arbitrarily there is no other bound as system memory.

That’s Bignum.


Nobu Nakada

I assume there will be a corresponding Float::MIN?

Farrel

···

Data Network Architecture Research Lab mailto:flifson@cs.uct.ac.za
Dept. of Computer Science http://people.cs.uct.ac.za/~flifson
University of Cape Town +27-21-650-3127

nobu.nokada@softhome.net schrieb im Newsbeitrag
news:200302101414.h1AEEC922638@sharui.nakada.kanuma.tochigi.jp…

Hi,

Does Ruby have an equivalent to Java’s Float.MIN_VALUE and
Float.MAX_VALUE (the smallest and largest finite numbers representable
respectively)? The pickaxe book doesn’t mention anything as such but
perhaps it has been added in newer Ruby versions.

Float::MIN and Float::MAX have been added in 1.8.

Since floats do grow arbitrarily there is no other bound as system
memory.

That’s Bignum.

Well, yes. In fact it depends on the type of application, whether you need
inf or max.

Regards

robert
···

At Mon, 10 Feb 2003 22:37:47 +0900, > Farrel Lifson wrote:
At Mon, 10 Feb 2003 22:54:06 +0900, > Robert Klemme wrote:

Hi,

I assume there will be a corresponding Float::MIN?

We have:

Float::ROUNDS (FLT_ROUNDS)
Float::RADIX (FLT_RADIX)
Float::MANT_DIG (DBL_MANT_DIG)
Float::DIG (DBL_DIG)
Float::MIN_EXP (DBL_MIN_EXP)
Float::MAX_EXP (DBL_MAX_EXP)
Float::MIN_10_EXP (DBL_MIN_10_EXP)
Float::MAX_10_EXP (DBL_MAX_10_EXP)
Float::MIN (DBL_MIN)
Float::MAX (DBL_MAX)
Float::EPSILON (DBL_EPSILON)

						matz.
···

In message “Re: Equivalent to Java’s Float.MAX_VALUE?” on 03/02/10, Farrel Lifson flifson@cs.uct.ac.za writes: