A
A
Alexander2019-05-23 18:24:25
JavaScript
Alexander, 2019-05-23 18:24:25

Floating point numbers in JS and the browser console are divided incorrectly. Is this a bug or a feature?

I am not a JS programmer and have little to do with web development in general, but due to the specifics of my work, I have to maintain a simple web application of my company in working order. There was a peculiar problem, floating-point numbers are divided incorrectly. As a result, I got to the browser console and got the following picture:
5ce6b80ca618a499345659.png
I checked it in Chrome, Fox, Yandex Browser. The picture is the same everywhere.
The problem is new for me, but I'm not sure that it is new for the company, maybe it was just not particularly critical and there was no point in paying attention.
For me personally, the solution is simple - shift the comma to the right in both numbers, but it still seems wrong.
Who faced it? Googling has not yielded results, or I simply do not have enough qualifications in this matter to correctly compose a search query. I would appreciate any information on my problem. Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2019-05-23
@mazart

Why is 0.1+0.2 not equal to 0.3 in JS?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question