Page MenuHomeFeedback Tracker

The floor command some times rounds a whole number down to the previous whole number
New, NormalPublic

Description

The floor command some times rounds a whole number down to the previous whole number. For example, I have observed the following behaviour.

2.6 * 7 - 0.2 = 18
floor 18 = 18
floor (2.6 * 7 - 0.2) = 17

This was experience in Arma 3 version: 1.64.138732

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
Windows 10 Home 64-bit (10.0, Build 14393)
Category
Scripting

Event Timeline

I found another example

2.6 * 12 - 0.2 = 31
floor 31 = 31
floor (2.6 * 12 - 0.2) = 30

I'm pretty sure this is normal floating-point imprecision which can't really be fixed.
2.6 * 7 - 0.2 isn't exactly 18, but something a little less.

Try putting this to the console's watch field and see if it returns false:

(2.6 * 7 - 0.2) isEqualTo 18