Skip to content

Bug fix in Float2Scalar #58

@abaranov25

Description

@abaranov25

The current implementation of transform in class Float2Scalar uses the conversion method .astype(int) which rounds down by default. I have observed a floating point error where 0.3 scales by 100 to 29.999997 which rounds down to 29 instead of the desired 30.

Proposing a three line fix to use a np.rint() check to round to the nearest integer instead of .astype(int) when values are closer than $10^{-8}$ to the nearest integer.

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