FloatNegate
Description
Negate a floating-point value in place.
Zero remains non-negative after normalization.
Parameters
| Name | Direction | Description |
|---|---|---|
value |
in,out | Float to modify |
Usage example (from documentation)
FloatNegate(&value);Success
Returns to the caller. The sign of *value is flipped unless *value is zero, which stays non-negative. Significand and exponent are unchanged.
Failure
Function cannot fail.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Float.c:909:
}
void FloatNegate(Float *value) {
ValidateFloat(value);- In
Float.c:1056:
return false;
}
FloatNegate(&rhs);
bool ok = float_add(result, a, &rhs);
FloatDeinit(&rhs);- In
Math.c:72:
bool test_float_negate_abs(void) {
WriteFmt("Testing FloatNegate and FloatAbs\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Math.c:79:
Str text = StrInit(&alloc.base);
FloatNegate(&value);
text = FloatToStr(&value);- In
Convert.c:357:
bool result = FloatExponent(&value) == 3;
FloatNegate(&value);
Str text = FloatToStr(&value);
Last updated on