Calc "Fixed" function appears to not be working properly

In this example:

=FIXED(G29/16384,0) where the value in G29 is -66576640, the full precision value is -4063.515625. As I understand the FIXED function, the function should only return the integer portion of a number (without rounding). So, I believe that the function should return -4063, and not -4064.

Is this a bug, or do I not understand the function correctly ?

The closest integer to -4,063.5156 is indeed -4,064.

Help for FIXED() says

Number is rounded to Decimals places

so if Decimals is 0 then it is rounded to integer.

If you want the integer portion then use INT(), or if for negative values as well then TRUNC().

values =INT(A2) =FIXED(A2;0) =ROUNDDOWN(A2)
-5,6 -6 -6 -5
-5,2 -6 -5 -5
-4,8 -5 -5 -4
-4,4 -5 -4 -4
-3,4 -4 -3 -3
-2,4 -3 -2 -2
-1,4 -2 -1 -1
-0,4 -1 0 0
0,4 0 0 0
0,8 0 1 0
1,2 1 1 1
1,6 1 2 1

So @gahelton should use ROUNDDOWN ?

btw: I would expect INT to behave like ROUNDDOWN with negative numbers, and vice versa!

No. INT() rounds towards negative infinity (down), ROUNDDOWN() rounds towards zero. Confusing? Yes.

Sorry, I see that “FIXED” does round the value. I had been looking at the function “FIX” which does not round, but apparently, this is not available in 7.6.4.1. The program keeps auto-correcting, and changing it to “FIXED”. But it appears that “FIX” does/did not round. The function “INT” rounds as well.

@gahelton your screenshot is from BASIC-Help, but not from CALC

ROUNDDOWN is exactly what I needed. Thanks for the feedback.