libera/#maemo/ Wednesday, 2018-08-22

brolin_empeyhttps://www.jwz.org/blog/2018/08/dark-rock-of-mothrir-unsealed-javascript-has-integers-now/08:11
brolin_empeyHeh 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
KotCzarnytry 1.0/3 or 1/3.009:10
KotCzarnyotherwise compiler treats right side as only integers, and rounds it correctly to 009:10
MaxdamantusThe sensible behaviour is for languages to not implicitly do arithmetic across different number types.09:23
Maxdamantusbut 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
KotCzarnybut most of all: people actually using those languages being aware of the details09:24
KotCzarnybe it js, c or whatever09:24
MaxdamantusI hadn't heard of the BigInt proposal until now, but they're doing the right thing by enforcing the separation.09:25
MaxdamantusIt would probably get a bit tedious though for languages that have more than two number types.09:25
KotCzarnyyou mean 'onenumber type'09:26
KotCzarny:)09:26
KotCzarnydarn, my space is dying09:26
MaxdamantusWell, supposedly ES with BigInts already has two.09:27
Maxdamantusalso, 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
Maxdamantusoh, nvm about the string thing, the exponent itself is already very large.09:40
Maxdamantusbut I'm guessing the test instructed it to print the number to the console, which might have been what was taking long.09:41
KotCzarnyhehe09:42

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!