bitsToReal

bitsToReal(integer x) → real real

Returns the real number whose internal representation is the integer x*: the 64 bits of *x are read as is, as a real in IEEE 754 format (double precision). It is the inverse of realBits.

Careful: the function does not read x as a binary number: bitsToReal(10110) does not return 22 but 4.995e-320, a tiny denormal number, because the integer 10110 only has a few low-order bits at 1. To write a number in binary, use the literal 0b10110.

bitsToReal(0)                    // 0.0
bitsToReal(4607182418800017408)  // 1.0
bitsToReal(4611686018427387904)  // 2.0
bitsToReal(1)                    // 4.9e-324: the smallest positive real
bitsToReal(realBits(3.5))        // 3.5
Math.bitsToReal(0)                    // 0.0
Math.bitsToReal(4607182418800017408)  // 1.0
Math.bitsToReal(4611686018427387904)  // 2.0
Math.bitsToReal(1)                    // 4.9e-324: the smallest positive real
Math.bitsToReal(0)                    # 0.0
Math.bitsToReal(4607182418800017408)  # 1.0
Math.bitsToReal(4611686018427387904)  # 2.0
Math.bitsToReal(1)                    # 4.9e-324: the smallest positive real
Parameters
Return
Note