N
N
not important .2021-06-20 09:38:33
JavaScript
not important ., 2021-06-20 09:38:33

Why do the numbers themselves add more than given?

let x = 12;
let y = 14;

x += 2.4;
y += 2.8;


here is a simple formula that the bot executes on a specific command and everything is fine, but every time the numbers x and y go beyond the number 20, for example:

y += 2.8 // enter the command 1 time y = 16.8
y += 2.8 // 2 once I enter the command y = 19.6
y += 2.8 // 3 times I enter the command y = 22.400000000000002

why do the numbers walk like that if I set the exact parameters of the formula?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-06-20
@26DiDi12

Because .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question