Skip to content

Compile option to process floating point values in single-precision, internally #84

@jrahlf

Description

@jrahlf

I have a project where I use single precision floats, but no doubles.
Problem is, that printf processes all floating point values as doubles, even if the caller is content with single precision formatting. On devices without double-FPU, this pulls in __aeabi_dsub, __aeabi_dmul and the likes, which are several kilobytes large.

My suggestion is to add a compile option so that floating point values are formatted with single precision.

The value would still be passed as a double to printf, which would then be converted to float.
Some of the required functionality seems to be already there, via the #if DBL_MANT_DIG == 24 define.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions