ieee754 1.0.0+1 copy "ieee754: ^1.0.0+1" to clipboard
ieee754: ^1.0.0+1 copied to clipboard

outdated

A library for parsing and encoding IEEE-754 binary floating point numbers.

Dart IEEE754 library #

pub

This library provides decoding and transforming IEEE754 floating point numbers in binary format, double format, or as exponent and mantissa.

Examples of use cases are serializing and deserializing formats which use the half or quad format, or encoding and converting numbers from arbitary exponents and mantissas.

Usage #

API reference

Example: Serializing to least precision #

void serializeDouble(double value) {
    final floatParts = FloatParts.fromDouble(value);
    if (floatParts.isFloat16Lossless) {
        _writeFloat16(floatParts.toFloat16Bytes());
    } else if (floatParts.isFloat32Lossless) {
        _writeFloat32(floatParts.toFloat32Bytes());
    } else if (floatParts.isFloat64Lossless) {
        _writeFloat64(floatParts.toFloat64Bytes());
    }
}
1
likes
0
pub points
64%
popularity

Publisher

verified publishernicbn.com

A library for parsing and encoding IEEE-754 binary floating point numbers.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta

More

Packages that depend on ieee754