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:881:
}
void FloatNegate(Float *value) {
ValidateFloat(value);- In
Float.c:1028:
return false;
}
FloatNegate(&rhs);
bool ok = float_add(result, a, &rhs);
FloatDeinit(&rhs);- In
Float.Math.c:26:
bool test_float_negate_abs(void) {
WriteFmt("Testing FloatNegate and FloatAbs\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Float.Math.c:33:
Str text = StrInit(&alloc.base);
FloatNegate(&value);
text = FloatToStr(&value);
Last updated on