3.2.2 Numerical Functions
| IntegerPart[x] | integer part of x | | FractionalPart[x] | fractional part of x | | Round[x] | integer closest to x | | Floor[x] | greatest integer not larger than x | | Ceiling[x] | least integer not smaller than x | | Rationalize[x] | rational number approximation to x | | Rationalize[x, dx] | rational approximation within tolerance dx |
Functions relating real numbers and integers.
| x | IntegerPart[x] | FractionalPart[x] | Round[x] | Floor[x] | Ceiling[x] | | 2.4 | 2 | 0.4 | 2 | 2 | 3 | | 2.5 | 2 | 0.5 | 2 | 2 | 3 | | 2.6 | 2 | 0.6 | 3 | 2 | 3 | | -2.4 | -2 | -0.4 | -2 | -3 | -2 | | -2.5 | -2 | -0.5 | -2 | -3 | -2 | | -2.6 | -2 | -0.6 | -3 | -3 | -2 |
Extracting integer and fractional parts. IntegerPart[x] and FractionalPart[x] can be thought of as extracting digits to the left and right of the decimal point. Round[x] is often used for forcing numbers that are close to integers to be exactly integers. Floor[x] and Ceiling[x] often arise in working out how many elements there will be in sequences of numbers with non-integer spacings.
| Sign[x] | 1 for , -1 for | | UnitStep[x] | 1 for , 0 for | | Abs[x] | absolute value of x | | Clip[x] | clipped to be between -1 and + 1 | Rescale[x, { , }] | rescaled to run from 0 to 1 |
Max[ , , ... ] or Max[{ , , ... }, ... ]
| | the maximum of , , ... |
Min[ , , ... ] or Min[{ , , ... }, ... ]
| | the minimum of , , ... |
Numerical functions of real variables.
| x + I y | the complex number | | Re[z] | the real part | | Im[z] | the imaginary part | | Conjugate[z] | the complex conjugate or | | Abs[z] | the absolute value | | Arg[z] | the argument such that |
Numerical functions of complex variables.
|