TRUNC

This document is no longer available beyond version 21. Information can now be found here: TRUNC for version 24

Parent page: System Query Functions - Arithmetic Functions

Summary

Returns an integral number, whose value depends upon the nature of the parameter's numeric value:

  • If that numeric value is positive but is not an exact integer, the number returned is the largest integer that is smaller in value than the parameter's numeric value.
  • If that numeric value is negative but is not an exact integer, the number returned is the smallest integer that is larger in value than the parameter's numeric value.
  • If that numeric value is an exact integer, the number returned has exactly the same value.

Syntax

TRUNC(X : Number / Numeric_String) : Number

Example Usage

TRUNC(5.0)
Returns 5.

TRUNC(5.33)
Returns 5.

TRUNC(-5.0)
Returns -5.

TRUNC(-5.33)
Returns -5.

Tips

  1. This is an alias for the INT arithmetic function.

 

If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.
Note

The features available depend on your Altium product access level. If you don’t see a discussed feature in your software, contact Altium Sales to find out more.