Skip to content

fix

Round toward zero (truncate).

B = fix(A)

Returns A with the fractional part removed. Same as floor for positive A, ceil for negative.

fix(2.7) % 2
fix(-2.7) % -2
  • floor — Round toward negative infinity.
  • ceil — Round toward positive infinity.
  • round — Round to the nearest integer (or to a specified number of digits).
  • trunc — Truncate toward zero.