
Calling Sequence


HFloat(M, E)
HFloat(M, E, base)


Parameters


M



expression

E



(optional) expression

base



(optional) 2 or default 10





Description


•

A hardware floatingpoint number (an object of type hfloat) is represented internally in Maple as a 64bit IEEE binary floatingpoint value.

•

The HFloat(M, E) command can be used to construct the hardware floatingpoint number M * base^E.


If the mantissa parameter M is of type imaginary, HFloat(M, E) returns I * HFloat(Im(M), E).


If the mantissa is of type nonreal, HFloat(M, E) returns HFloat(Re(M), E) + I * HFloat(Im(M), E).


Maple also has arbitraryprecision software floatingpoint numbers, of type sfloat (see type/sfloat), which can be constructed using the SFloat or Float constructor.

•

The maximum number of digits in the mantissa of a hardware float, and the maximum and minimum allowable exponents, can be obtained from evalhf (see evalhf/constant).

•

A hardware float, H, can be converted to a software float using SFloat(H). Similarly, a software float, S, can be converted to a hardware float using HFloat(S).

•

The presence of a hardware floatingpoint number in an expression generally implies that the computation will use hardware floatingpoint evaluation, unless the settings of Digits and UseHardwareFloats specify otherwise (see UseHardwareFloats).

•

An expression can be forced to evaluate entirely using hardware floatingpoint by enclosing it in a call to evalhf. However, some expressions, notably those involving data structures, cannot be evaluated by evalhf.

•

Entire procedures can be written to work using hardware floats without the restrictions imposed by evalhf by adding option hfloat to the procedure (see option_hfloat).

•

The number of digits carried in the mantissa for hardware floatingpoint arithmetic is approximately 15. More digits are displayed to ensure a base 10 representation from which the underlying binary hardware floatingpoint value can be reliably reconstructed.

•

Maple includes a variety of numeric functions to use with both hardware and software floatingpoint numbers.

•

The behaviors of hardware floatingpoint infinities, undefined values (so called "Not a Number", or "NaN", in IEEE nomenclature), and zero, are analogous to the corresponding software floatingpoint concepts. For details, see Float.



Examples


>

$\mathrm{HFloat}\left(2.3\right)$

>

$\mathrm{HFloat}\left(2.\right)$

>

$\mathrm{HFloat}\left(0.3\right)$

${\mathrm{0.300000000000000}}$
 (3) 
>

$\mathrm{HFloat}\left(23000.\right)$

${\mathrm{2.760000000}}{\times}{{10}}^{{9}}$
 (5) 
>

$\mathrm{type}\left(\,\mathrm{hfloat}\right)$



