Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
number_properties
determine floating-point parameters
Syntax
pr = number_properties(prop)
Arguments
- prop
string
- pr
real or boolean scalar
Description
This function may be used to get the characteristic
numbers/properties of the floating point set denoted here by
F(b,p,emin,emax)
(usually the 64 bits float numbers set
prescribe by IEEE 754). Numbers of F
are of the
form:
sign * m * b^e
e
is the exponent and m
the
mantissa:
the digits are in [0, b-1]
and e
in [emin, emax]
, the number is
said "normalized" if . The following may be
gotten:
- prop = "radix"
then
pr
is the radixb
of the setF
- prop = "digits"
then
pr
is the number of digitsp
- prop = "huge"
then
pr
is the max positive float ofF
- prop = "tiny"
then
pr
is the min positive normalized float ofF
- prop = "denorm"
then
pr
is a boolean (%t if denormalized numbers are used)- prop = "tiniest"
then if denorm = %t,
pr
is the min positive denormalized number elsepr
= tiny- prop = "eps"
then
pr
is the epsilon machine ( generally () which is the relative max error between a realx
(such than|x|
in[tiny, huge]
) andfl(x)
, its floating point approximation inF
- prop = "minexp"
then
pr
isemin
- prop = "maxexp"
then
pr
isemax
Remarks
This function uses the lapack routine dlamch to get the machine parameters (the names (radix, digit, huge, etc...) are those recommended by the LIA 1 standard and are different from the corresponding lapack's ones).
CAUTION: sometimes you can see the following definition for the
epsilon machine : but in this function we
use the traditional one (see prop = "eps" before) and so
if normal rounding occurs and
if not. |
Examples
b = number_properties("radix") eps = number_properties("eps")
See also
Report an issue | ||
<< nextpow2 | Floating point | round >> |