Joost has asked for the wisdom of the Perl Monks concerning the following question:
I'm working at some Perl/XS code that needs knowledge of the minimum and maximum values for floating point numbers (that is, floats). I know this is system-dependent, but I would like to know how to get at this information from Perl.
I've been searching the docs and the only thing I can find is this entry in the Config manpage:
The same thing seems to be the case for integers and Perl's integer and float types too, by the way."i_float" From i_float.U: This variable conditionally defines the "I_FLOAT" symbol, and indicates whether a C program may include <float.h> to get symbols like "DBL_MAX" or "DBL_MIN", i.e. machine dependent floating point values.
It seems strange to me that this information is not available. Does anyone know of a way to get at this info from Perl? I might be tempted to create a seperate XS module for it otherwise.
Yours,
Joost.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to determine MIN and MAX values for floating point number
by sauoq (Abbot) on Dec 09, 2003 at 21:19 UTC | |
by ysth (Canon) on Dec 10, 2003 at 00:06 UTC | |
by Joost (Canon) on Dec 09, 2003 at 21:37 UTC | |
|
Re: How to determine MIN and MAX values for floating point number
by sleepingsquirrel (Chaplain) on Dec 09, 2003 at 21:50 UTC | |
|
Re: How to determine MIN and MAX values for floating point number
by zentara (Cardinal) on Dec 10, 2003 at 21:07 UTC | |
|
Re: How to determine MIN and MAX values for floating point number
by hardburn (Abbot) on Dec 09, 2003 at 21:26 UTC | |
by sauoq (Abbot) on Dec 09, 2003 at 21:47 UTC | |
by Joost (Canon) on Dec 09, 2003 at 21:39 UTC |