brolin_empey | https://www.jwz.org/blog/2018/08/dark-rock-of-mothrir-unsealed-javascript-has-integers-now/ | 08:11 |
---|---|---|
brolin_empey | Heh at the comment from margaret. I tried it myself and got the same result, with the type of r both double and float. | 08:11 |
KotCzarny | try 1.0/3 or 1/3.0 | 09:10 |
KotCzarny | otherwise compiler treats right side as only integers, and rounds it correctly to 0 | 09:10 |
Maxdamantus | The sensible behaviour is for languages to not implicitly do arithmetic across different number types. | 09:23 |
Maxdamantus | but afaik, the only well-known language to do that properly is Haskell, because it has HM type inference, which means you're not forced to write things like `1f/2f` | 09:23 |
KotCzarny | but most of all: people actually using those languages being aware of the details | 09:24 |
KotCzarny | be it js, c or whatever | 09:24 |
Maxdamantus | I hadn't heard of the BigInt proposal until now, but they're doing the right thing by enforcing the separation. | 09:25 |
Maxdamantus | It would probably get a bit tedious though for languages that have more than two number types. | 09:25 |
KotCzarny | you mean 'onenumber type' | 09:26 |
KotCzarny | :) | 09:26 |
KotCzarny | darn, my space is dying | 09:26 |
Maxdamantus | Well, supposedly ES with BigInts already has two. | 09:27 |
Maxdamantus | also, regarding that post, I suspect it would be a lot quicker to find the maximum size by just calling the `BigInt` constructor passing a string. | 09:30 |
* Maxdamantus builds V8. | 09:32 | |
Maxdamantus | oh, nvm about the string thing, the exponent itself is already very large. | 09:40 |
Maxdamantus | but I'm guessing the test instructed it to print the number to the console, which might have been what was taking long. | 09:41 |
KotCzarny | hehe | 09:42 |
Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!