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:917:
}
void FloatAbs(Float *value) {
ValidateFloat(value);
value->negative = false;- In
Type.c:58:
Str text = FloatToStr(&clone);
FloatAbs(&original);
bool result = FloatEQ(&clone, &expected);- In
Math.c:72:
bool test_float_negate_abs(void) {
WriteFmt("Testing FloatNegate and FloatAbs\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Math.c:85:
StrDeinit(&text);
FloatAbs(&value);
text = FloatToStr(&value);
result = result && (ZstrCompare(StrBegin(&text), "12.5") == 0);
Last updated on