Float class

A wrapper for explicitly serializing a double as a 32-bit float.

In MessagePack, Dart's double type (64-bit) is serialized as float 64 by default. Use Float to force serialization as float 32, saving 4 bytes when full 64-bit precision is not required.

Example:

final data = packer.pack(Float(3.14)); // Encoded as float 32

Constructors

Float(double value)
Creates a Float wrapper for the given value.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value double
The underlying double value.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited