3 ms·
0 is also the behaviour of C and of pretty much any serious programming language.
by mgaunard 3y ago
0 is also the behaviour of C and of pretty much any serious programming language.
- leadingthenet 3y agoI 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.
- xdennis 3y agoBut 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.
- Hamuko 3y agoI 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.
- mgaunard 3y agoThat'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.
- Joker_vD 3y agoI've always suspected that Pascal and Haskell were not serious programming languages, thank you for confirming my suspicion.
- mgaunard 3y agoNotice how I said most; also I would argue that yes, those aren't really serious programming languages. Haskell is an academic experiment and is mostly esoteric in the industry. It has however impacted a number of other languages that do get some use. Pascal is way past its prime and no major company is giving it significant support anymore.
- lelanthran 3y ago> I've always suspected that Pascal and Haskell were not serious programming languages, thank you for confirming my suspicion. I wouldn't really group Pascal and Haskell together (unless we're playing rhyming games). One of those had serious market penetration, a whole industry behind it and was one of the dominant choices for applications languages ... for maybe two full decades (including Turbo Pascal all the way through to Delphi). I mean, right now, Delphi is still orders of magnitudes more popular and in use than Haskell, which is used by .... pandoc, maybe?