|
| 1 | +<!-- |
| 2 | +title: MATH |
| 3 | +weight: 4601 |
| 4 | +--> |
| 5 | + |
| 6 | +# Math Functions |
| 7 | +This function package exposes common math functions. |
| 8 | + |
| 9 | +## ceil() |
| 10 | +Ceil returns the least integer value greater than or equal to input |
| 11 | + |
| 12 | +### Input Args |
| 13 | + |
| 14 | +| Arg | Type | Description | |
| 15 | +|:------------|:-------|:-----------------| |
| 16 | +| inputNumber | number | The input number | |
| 17 | + |
| 18 | +### Output |
| 19 | + |
| 20 | +| Arg | Type | Description | |
| 21 | +|:----------|:-------|:-----------------------------------| |
| 22 | +| returnVal | number | The ceil value of the input number | |
| 23 | + |
| 24 | + |
| 25 | +## floor() |
| 26 | +Floor returns the greatest integer value less than or equal to input |
| 27 | + |
| 28 | +### Input Args |
| 29 | + |
| 30 | +| Arg | Type | Description | |
| 31 | +|:------------|:-------|:-----------------| |
| 32 | +| inputNumber | number | The input number | |
| 33 | + |
| 34 | +### Output |
| 35 | + |
| 36 | +| Arg | Type | Description | |
| 37 | +|:----------|:-------|:------------------------------------| |
| 38 | +| returnVal | number | The floor value of the input number | |
| 39 | + |
| 40 | + |
| 41 | +## isNaN() |
| 42 | +IsNaN reports whether input is an IEEE 754 "not-a-number" value |
| 43 | + |
| 44 | +### Input Args |
| 45 | + |
| 46 | +| Arg | Type | Description | |
| 47 | +|:------|:-------|:------------------| |
| 48 | +| input | any | The input to test | |
| 49 | + |
| 50 | +### Output |
| 51 | + |
| 52 | +| Arg | Type | Description | |
| 53 | +|:----------|:--------|:--------------------------------------------| |
| 54 | +| returnVal | boolean | Is true if input is IEEE 754 "not-a-number" | |
| 55 | + |
| 56 | + |
| 57 | +## mod() |
| 58 | +Mod returns the floating-point remainder of x/y. The magnitude of the result is less than y and its sign agrees with that of x |
| 59 | + |
| 60 | +### Input Args |
| 61 | + |
| 62 | +| Arg | Type | Description | |
| 63 | +|:----|:-------|:----------------------------| |
| 64 | +| x | number | The dividend or first input | |
| 65 | +| y | number | The divisor or second input | |
| 66 | + |
| 67 | +### Output |
| 68 | + |
| 69 | +| Arg | Type | Description | |
| 70 | +|:----------|:-------|:--------------------------------------------------| |
| 71 | +| returnVal | number | The remainder of the Euclidean division of x by y | |
| 72 | + |
| 73 | + |
| 74 | +## round() |
| 75 | +Round returns the nearest integer, rounding half away from zero |
| 76 | + |
| 77 | +### Input Args |
| 78 | + |
| 79 | +| Arg | Type | Description | |
| 80 | +|:------------|:-------|:-----------------| |
| 81 | +| inputNumber | number | The input number | |
| 82 | + |
| 83 | +### Output |
| 84 | + |
| 85 | +| Arg | Type | Description | |
| 86 | +|:----------|:-------|:--------------------------------------------------| |
| 87 | +| returnVal | number | The nearest integer, rounding half away from zero | |
| 88 | + |
| 89 | + |
| 90 | +## roundToEven() |
| 91 | +RoundToEven returns the nearest integer, rounding ties to even |
| 92 | + |
| 93 | +### Input Args |
| 94 | + |
| 95 | +| Arg | Type | Description | |
| 96 | +|:------------|:-------|:-----------------| |
| 97 | +| inputNumber | number | The input number | |
| 98 | + |
| 99 | +### Output |
| 100 | + |
| 101 | +| Arg | Type | Description | |
| 102 | +|:----------|:-------|:-------------------------------------------| |
| 103 | +| returnVal | number | The nearest integer, rounding ties to even | |
| 104 | + |
| 105 | + |
| 106 | +## trunc() |
| 107 | +Trunc returns the integer value of input |
| 108 | + |
| 109 | +### Input Args |
| 110 | + |
| 111 | +| Arg | Type | Description | |
| 112 | +|:----|:-------|:----------------------------| |
| 113 | +| inputNumber | number | The input number | |
| 114 | + |
| 115 | +### Output |
| 116 | + |
| 117 | +| Arg | Type | Description | |
| 118 | +|:----------|:-------|:-----------------------------------------| |
| 119 | +| returnVal | number | The truncated integer value of the input | |
0 commit comments