Files
mql5-skills/skills/mql5/references/docs/34-standardlibrary/1285-standardlibrary-mathematics-stat-mathsubfunctions-statmathtrunc.md
T
2026-06-23 21:47:51 +08:00

62 lines
1.2 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# MathTrunc
Calculates the integer part of the specified number or array elements.
Version for working with a double-precision floating-point number:
```
double  MathTrunc(
   const double   x          // value of the number
   )
```
Return Value
The integer part of the specified number.
Version for working with an array of double-precision floating-point numbers. The results are output to a new array:
```
bool  MathTrunc(
   const double&  array[],   // array of values
   double&        result[]   // array of results
   )
```
Return Value
Returns true if successful, otherwise false.
Version for working with an array of double-precision floating-point numbers. The results are output to the original array:
```
bool  MathTrunc(
   double&        array[]    // array of values
   )
```
Return Value
Returns true if successful, otherwise false.
Parameters
x
[in]  Double-precision floating-point number, the integer part of which is to be obtained.
array[]
[in] Array of double-precision floating-point numbers, the integer parts of which are to be obtained.
array[]
[out] Array of output values.
result[]
[out] Array of output values.