Slider: Add validation considering steps#13
Slider: Add validation considering steps#13PJZ9n wants to merge 1 commit intodktapps-pm-pl:masterfrom
Conversation
|
This is unreliable because of floating-point errors. There's a very good chance that this check will fail in valid circumstances because of it. |
|
I think that it is necessary to calculate with the same accuracy as MCPE to solve it accurately, but as an alternative method, can the problem be solved by aligning the values according to the number of digits of the step? If so, I don't think there is a practical problem. |
No. It's like the old meme about |
$step = 0.001;
$value = 6.006000518798828;
$a = round($value, strlen((string)$step));//float(6.006)
$b = $a / $step;//float(6006)
var_dump(ctype_digit((string)$b));//bool(true)However, this is a successful calculation. Of course there is a possibility of an error, but is this a practical problem? |
No description provided.