Determine encoding for floating point values

.determineEncoding(
  x,
  precision = "single",
  decimals = NULL,
  range = NULL,
  fields = NULL
)

Arguments

x

numeric(.)
a set of numeric values for which to determine the floating point encoding.

precision

character(1)
option that determines the configuration of the floating point encoding. Possible values are "half" [1.5.10], "bfloat16" [1.8.7], "tensor19" [1.8.10], "fp24" [1.7.16], "pxr24" [1.8.15], "single" [1.8.23], "double" [1.11.52] and "auto" (where the positions are determined based on the provided numeric values in x; not supported yet).

decimals

integer(1)
the number of decimal digits that should be reliably represented, not supported yet.

range

numeric(2)
the ratio between the smallest and largest possible value to be reliably represented, not supported yet.

fields

list(3)
list that controls how many bits are allocated to sign, exponent and mantissa for encoding the numeric values.

Details

For background information study for instance 'Floating Point' by Thomas Finley and check out https://float.exposed/ to play around with floating point encoding.