Hacker News new | ask | show | jobs
by leadingthenet 780 days ago
I feel like everyone making comments along this line is completely missing his point.

It's not wrong that 0 is the behaviour of C/Ruby, it's just that 1/2=0.5 is the expected result of much of Python's target audience.

1 comments

But it's not. In second grade I was taught that 1/2 is 0 (with a remainder of 1). Fractions, real numbers, complex... are taught afterwards.
I don't think the target audience of Python are second-graders, but rather people who have graduated elementary school and realise that 1/2 comes out to 0.5.
That's silly, in math those two are just different notations for the same thing, and usually fractions are preferred.

Also anyone who's done any bit of programming should know that numbers as represented by a computer are discrete, while mathematics deal with symbolic relations which might require infinite amount of data to numerically represent.

Binary floating-point can't even represent 0.1.