"FPDP" Double precision floating point and "FPSP" Single precision floating point

Fingerprint ID:0x46504450 (FPDP) and 0x46505350 (FPSP)

These fingerprints, from RC/Funge-98, implement operations on single and double precision floating point number. Single precision floating point number occupies one stack cell, while double precision occupies two stack cells. They provide the following commands:

A : xfp yfp(x+y)fp
Adds two floating point numbers.
B : xfpsin(x)fp
Calculates sine of floating point number.
C : xfpcos(x)fp
Calculates cosine of floating point number.
D : xfp yfp(x÷y)fp
Divides two floating point numbers.
E : xfparcsin(x)fp
Calculates arcsine of floating point number.
F : nxfp
Converts integer to floating point number.
G : xfparctan(x)fp
Calculates arctangent of floating point number.
H : xfparccos(x)fp
Calculates arccosine of floating point number.
I : xfpn
Converts floating point number to integer, discarding the fraction part.
K : xfplog(x)fp
Calculates natural logarithm of floating point number.
L : xfplog10(x)fp
Calculates common (base 10) logarithm of floating point number.
M : xfp yfp(x×y)fp
Multiplies two floating point numbers.
N : xfp-xfp
Negates floating point number.
P : xfp
Prints floating point number.
Q : xfpsqrt(x)fp
Calculates the square root of floating point number.
S : xfp yfp(x-y)fp
Subtracts two floating point numbers.
T : xfptan(x)fp
Calculates tangent of floating point number.
V : xfpabs(x)fp
Calculates the absolute value of floating point number.
X : xfpexp(x)fp
Calculates the exponential of floating point number.
Y : xfp yfp(x^y)fp
Raises y to the power of x.

In PyFunge these single and double precision floating point number are implemented as IEEE 754 single precision (32-bit) and double precision (64-bit) format. A single precision number occupies one cell, and a double precision number occupies two cells for lower and upper 32 bits, in the unspecified (endian-specific) order. PyFunge ignores all bits except the lowermost 32 bits for such cells.

The precise operations on floating point numbers are done as specified in IEEE 754. So it correctly handles infinities and NaNs (Not a Number).

Previous topic

"FPRT" Formatted print

Next topic

"FRTH" Some common forth commands

This Page

Quick search