Skip to content

Enhancement: "businesslike conduct" round to reduce data error from 0.09 to 0.05 (~50% accuracy enhancement) #3

Open
@g6094199

Description

@g6094199

hi,

we have seen some problems when it comes to rounding (in our case for temp measurements).

in the current code the float temp just gets cut after the 1st decimal place, which is very inaccurate!

float celsius; int16_t val = celsius * 10;

in this case the error is at worst 0.09. almost 0.1° off.

instead the float temp should be businesslike conduct rounded (in germany we call this "Kaufmännisches Runden") before chopping off the last diget, like so:

float celsius; int16_t val = round(celsius * 10);

in this case the error is @ max. 0.05° off. which is much more accurate for professional use. of cause other values can benefit from this kind of correction, too.

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