V
V
vitaly_742018-03-15 22:09:11
PHP
vitaly_74, 2018-03-15 22:09:11

Php does not divide by small numbers, what's the problem?

Good afternoon, I divided 1 / 0.000001 in PHP and the puff gives an error saying that you divide by zero, and it doesn’t give a result, js, in turn, divides the numbers of norms, what could be the problem? and what to do to make it work?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
index0h, 2018-03-15
@vitaly_74

https://3v4l.org/Xej0s
The problem is in your hands, you put a comma instead of a dot

R
RidgeA, 2018-03-15
@RidgeA

in php - comma? If yes, change to a dot

D
Dmitry, 2018-03-15
@demon416nds

google floating point numbers)) it’s trite that the precision of the number is not enough to notice the difference with zero,
and js most likely considers long arithmetic in such cases
ps there are libraries for long arithmetic under php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question