Skip to content

Question about rounding #154

@GitCaptain

Description

@GitCaptain

Hi, @jansel, I've been looking through your manipulator code, and stuck on these lines:

if self.is_integer_type():
# account for rounding
low -= 0.4999
high += 0.4999

Could you please explain this strange rounding?
What is 0.4999 const (why not 0.5)?
Also, isn't it possible that we will go beyond the allowed range (because we rounding low to the floor and high to the ceil)?
And if we check, that low and high are integrals (self.is_integer_type), why is this rounding needed at all?

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