protocol
ieee_754_protocol
IEEE 754 floating-point support library protocol. Intended to be implemented by parameterized objects such as ieee_754(Precision, ByteOrder, NaNRepresentation).
logtalk_load(ieee_754(loader))staticPublic predicates
parse/2
Parses an IEEE 754 value from a source term for the selected precision, byte order, and NaN representation policy. Supported source terms are bytes(Bytes) and bits(Bits).
staticparse(Source,Value)parse(++compound,--term) - one_or_errorSource is a variable:instantiation_errorSource is neither a variable nor a valid source term:domain_error(ieee_754_source,Source)Source does not contain a valid encoding for the selected object:domain_error(ieee_754_encoding,Source)generate/2
Generates an IEEE 754 encoding for a value term using the selected precision and byte order. Supported sink terms are bytes(Bytes) and bits(Bits). Finite values are encoded using the selected precision rounding semantics.
staticgenerate(Sink,Value)generate(+compound,++term) - one_or_errorSink is a variable:instantiation_errorSink is neither a variable nor a valid sink term:domain_error(ieee_754_sink,Sink)Value is neither a valid finite float nor a supported IEEE 754 special value term:domain_error(ieee_754_value,Value)Value cannot be represented in the selected precision:domain_error(ieee_754_representation,Value)generate/3
Generates an IEEE 754 encoding as a list of bytes with an open tail. Intended for use by libraries that build larger binary payloads using difference lists.
staticgenerate(Value,Bytes,Tail)generate(+term,-list(byte),--variable) - one_or_errorValue is neither a valid finite float nor a supported IEEE 754 special value term:domain_error(ieee_754_value,Value)Value cannot be represented in the selected precision:domain_error(ieee_754_representation,Value)valid/1
True iff the argument is a valid value term for the selected object. Valid terms are finite floats plus the special values supported by the selected NaN representation policy.
staticvalid(Value)valid(@term) - zero_or_oneexactly_representable/1
True iff the argument can be encoded in the selected precision and decoded again without loss of value information under the selected NaN representation policy. Intended for callers such as MessagePack that choose the smallest exact binary format.
staticexactly_representable(Value)exactly_representable(@term) - zero_or_oneprecision/1
Returns the selected IEEE 754 precision. Expected values are half, single, or double.
staticprecision(Precision)precision(-atom) - oneorder/1
Returns the selected byte order. Expected values are big or little.
staticorder(ByteOrder)order(-atom) - onenan_representation/1
Returns the selected NaN representation policy. Expected values are canonical and payloads.
staticnan_representation(NaNRepresentation)nan_representation(-atom) - onebyte_count/1
Returns the number of bytes used by the selected precision.
staticbyte_count(ByteCount)byte_count(-integer) - oneProtected predicates
(none)
Private predicates
(none)
Operators
(none)