FloatAbs
Description
Replace a float with its absolute value.
Parameters
| Name | Direction | Description |
|---|---|---|
value |
in,out | Float to modify |
Usage example (from documentation)
FloatAbs(&value);Success
Returns to the caller. *value is now non-negative; significand and exponent are unchanged.
Failure
Function cannot fail.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Float.c:889:
}
void FloatAbs(Float *value) {
ValidateFloat(value);
value->negative = false;- In
Float.Type.c:57:
Str text = FloatToStr(&clone);
FloatAbs(&original);
bool result = FloatEQ(&clone, &expected);- In
Float.Math.c:26:
bool test_float_negate_abs(void) {
WriteFmt("Testing FloatNegate and FloatAbs\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Float.Math.c:39:
StrDeinit(&text);
FloatAbs(&value);
text = FloatToStr(&value);
result = result && (ZstrCompare(StrBegin(&text), "12.5") == 0);
Last updated on