|
|
Release 4.0 |
 |
Operators - |...| (modulus squared)
Operator : | |...| - modulus squared |
Unary / binary: | Unary |
Prefix / infix: | N/A |
Input data type |
Output data type |
|
real |
real |
complex |
real |
vector |
real |
quaternion |
real |
Notes:
Normally this operator is defined to calculate the modulus of its operand. But due to compatibility reasons and due to speed this operator only
calculates the modulus squared of its operand.
Thus this function is defined as follows:
- for real numbers r:
|r| := r*r
- for complex numbers c=(cr,ci):
|c| := cr*cr+ci*ci
- for vectors v=(x,y,z):
|v| := x*x+y*y+z*z
- for quaternion numbers q=(qr,qi,qj,qk):
|q| := qr*qr+qi*qi+qj*qj+qk*qk
If you want to calculate the modulus of a number, you can write sqrt(|c|) or use the
function cabs.
|