>>> round(1.5) 2 >>> round(0.5) 0 >>> round(90.5) 90

wtf python

Follow

@xarvos the joys of floating point arithmetic

@niplav hmm roundf() doesn’t behave like this but printf format does, it seems

@xarvos ah ok I'd have been very confused if python was unique in that respect

Sign in to participate in the conversation
Mastodon

a Schelling point for those who seek one