Numy v0.1.2 Numy.Float View Source

Floating point number utilities.

Link to this section Summary

Functions

Convert bit-by-bit 64-bit float to 64-bit integer.

Equality comparison for floating point numbers.

Return true if sign bit is 1 in the binary representation of the number.

ULP difference.

Link to this section Functions

Convert bit-by-bit 64-bit float to 64-bit integer.

Link to this function

copysignbit(src, dst)

View Source
copysignbit(float(), float()) :: float()
Link to this function

equal?(a, b, epsilon \\ 1.0e-9, max_ulps \\ 4)

View Source
equal?(number(), number(), float(), pos_integer()) :: boolean()

Equality comparison for floating point numbers.

Based on this blog post by Bruce Dawson.

Link to this function

from_number(n)

View Source
from_number(number()) :: float()
Link to this function

make_list_randoms(size, list \\ [])

View Source
Link to this function

sign(x)

View Source
sign(number()) :: -1 | 0 | 1

Return true if sign bit is 1 in the binary representation of the number.

IEEE Long Real 64-bit binary format:

  • 1 bit for the sign,
  • 11 bits for the exponent,
  • and 52 bits for the mantissa
Link to this function

ulp_diff(a, b)

View Source
ulp_diff(float(), float()) :: integer()

ULP difference.