Class CBORFloat

java.lang.Object
org.webpki.cbor.CBORObject
org.webpki.cbor.CBORFloat
All Implemented Interfaces:
Cloneable, Comparable<CBORObject>

public class CBORFloat extends CBORObject
Class for holding CBOR float objects.

Floating-point numbers are expressed in the IEEE 754 format using the length 16, 32, and 64 bit on the "wire". Which length to use is governed by the size and precision required to (minimally) correctly represent a value.

See Also:
  • Constructor Details

    • CBORFloat

      public CBORFloat(double value)
      Creates a CBOR float object.

      This constructor only implements support for finite ("regular") floating point numbers. That is, a Double.NaN argument causes a CBORException to be thrown.

      CBORObject.getFloat64() is the decoder counterpart.

      For NaN and Infinity support see createExtendedFloat(double).

      Parameters:
      value - Floating-point value
  • Method Details