Hacker News new | past | comments | ask | show | jobs | submit login

The article doesn't really say what's going on under the hood but I'd guess that division of integers makes rationals...

> Pyret has numbers, because we believe an 8GB machine should not limit students to using just 32 bits.

Emphasis mine. WTF, author.

But the Java sample below saying "this is false" implies that floats are a problem that is being avoided. The only reasonable solution is rationals... right?




Yep, this is a project out of the same world as Racket which does a similar thing.

If you go into the editor/REPL (https://code.pyret.org/editor) and enter 1/3, you'll see that it gets rendered as 0.3 repeating (with a bar, not some arbitrary rounding) or if you click on it, directly as 1/3.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: