OH NO NO NO NO

johngustafson.net/pdfs/BeatingFloatingPoint.pdf

Floating point was a mistake

>Rounding is done towards the closest even value
It's right there in the pydocs. RTFM idiot

You dumb fuck, both 3.5 and 4.5 are PRECISELY represented in binary floating point yet one is rounded upwards and the other is rounded downwards. It's not about the binary or decimal representation, the actual reason for that has already been said in this thread.

what's the ideal rounding method? justify your answer

depends on the context

≥ .5 is rounded up, the rest is rounded down.

I think rounding shouldn't be based on the utter stupidity.

Hello Vlad

github.com/python/cpython/blob/v3.7.2/Python/pymath.c#L71-L80
What exactly makes floor(fabs(x)) - fabs(x) >= 0.5 untrue here, given that 4.5 and 6.5 can be represented as exact floating point numbers?