Hacker News new | ask | show | jobs
by lalaithion 846 days ago
To be fair, Python's `/` creates floats, and this article is about a second operator `//`.
2 comments

Continuing in fairness, lisp is a bit more involved, here. If you do `(/ 1.0 3)`, you do not get a rational. Similarly, any division that is not integer/rational there will get treated mostly as expected.

Basically, it seems as soon as you introduce a floating point number, it stays there. Which is roughly what I would expect.

In python 2, '/' creates integers, and the article was written in 2010 when python 2 was the most used by far.
from the link:

> PS. Note that I am using // instead of / -- this is Python 3 syntax

Oh. Right.