Skip to content

Single-precision doubles always written at FLOAT64 instead of FLOAT32 #489

@mattbishop

Description

@mattbishop

A single-precision decimal value should be written as a smaller FLOAT32 instead of always using FLOAT64. A simple test for single-precision can be added to ImmutableDoubleValueImpl:

        public void writeTo(MessagePacker pk) throws IOException {
            // ValueFactory always writes a float64; needs to be a float32 for single-precision
            if (toDouble() == toFloat()) {
                pk.packFloat(toFloat());
            } else {
                pk.packDouble(toDouble());
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions