Live data from Hacker News

NoJS – Creating a calculator with only HTML and CSS

blog.scottlogic.com

41–48 of 48 posts

Re: NoJS – Creating a calculator with only HTML and CSS

#42
post #36
post #34

Earlier quoted context omitted.

Hi, Please could you give me the exact input, wrong answer and also browser? Thank you:)

In Safari 15.2, everything is rounded down. 1/2 = 0, 8/9 = 0. Also, it's not possible to type decimal numbers and have them displayed, although it appears they are actually being used internally. Initially, the "." button is disabled. If you press 0, then the "." button is enabled, disappears when clicked (good up to here), but then clicking any of the numbers don't change the display. So, typing "0.9 + 0.9" will loo…

Ah yes, safari.

I should be able to fix the rounding errors. I should disable the decimals completely in safari as my method of getting decimals isnt supported yet. (@property).

Thank you so much for the feedback

Re: NoJS – Creating a calculator with only HTML and CSS

#43
post #32

Earlier quoted context omitted.

99999 * 9999 also yields wrong result

Hi, What browser and device are you on? And what result does it show

For 99999 x 9999:

Firefox 96 displays 999889984

Edge 97 displays 999890001

The answer should be 999890001, so Edge is right and Firefox is wrong

Re: NoJS – Creating a calculator with only HTML and CSS

#44
post #43
post #32

Earlier quoted context omitted.

Hi, What browser and device are you on? And what result does it show

For 99999 x 9999: Firefox 96 displays 999889984 Edge 97 displays 999890001 The answer should be 999890001, so Edge is right and Firefox is wrong

Multiplying the 32bit floats 99999.0f and 9999.0f results in 999889984 (Firefox's result). So I guess this hints at what Firefox might be doing :)

Float multiplication's result: https://godbolt.org/z/q857f51GP

Re: NoJS – Creating a calculator with only HTML and CSS

#46
post #43
post #32

Earlier quoted context omitted.

Hi, What browser and device are you on? And what result does it show

For 99999 x 9999: Firefox 96 displays 999889984 Edge 97 displays 999890001 The answer should be 999890001, so Edge is right and Firefox is wrong

Thanks,

Re: NoJS – Creating a calculator with only HTML and CSS

#48

Unfortunately, it does not seem to work on Firefox for Android. Pressing any digit will always produce a 0 value

works for me (But I use Fennec from F-Droid)

I haven't heard of Fennec before. What do you like about it over vanilla Firefox?
Post reply on HN