Package org.webpki.util
Class DoubleCoreSerializer
java.lang.Object
org.webpki.util.DoubleCoreSerializer
An implementation of Ryu for serializing IEEE-754 double precision values
as specified by ECMAScript
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
DoubleCoreSerializer
public DoubleCoreSerializer()
-
-
Method Details
-
serialize
Formats a number according to ECMAScript.This code is emulating 7.1.12.1 of the EcmaScript V6 specification.
Note: {-
}0.0
,NaN
, and±Infinity
is out of scope for this method.- Parameters:
value
- Value to be formattedecmaOriginalMode
- Iftrue
use EcmaScript notation. Iffalse
use EcmaScript notation but always output a decimal point and at least one fractional digit. The latter is compatible with CBOR diagnostic notation- Returns:
- String representation
-