enFloat contains float manipulation tools.
| Name | Returns | Parameters | Description |
|---|---|---|---|
| enFloat_AlphaFromRGBA(...) | float | string rgba | Returns the alpha value from an "rgba(R, G, B, A)" formatted string, or -1.0 if the string could not be parsed. See enVector_FromColor() for the RGB values. |
| enFloat_Clamp(...) | float | float f float minimum float maximum |
Clamps a float to minimum and maximum values. |
| enFloat_Compress(...) | string | float f | Converts a float to a compressed string. |
| enFloat_Decompress(...) | float | string s | Converts a result of enFloat_Compress(...) back to a float. |
| enFloat_FlipCoin(...) | integer | float chance | Flips a coin with a specified chance of returning TRUE from 0.0 to 1.0. |
| enFloat_RandRange(...) | float | float minimum float maximum |
Returns a random value between minimum and maximum. |
| enFloat_ResetChunk(...) | float | float f float minimum float maximum float chunk |
Adds/subtracts chunk to/from f until it is between minimum and maximum. |
| enFloat_ResetTarget(...) | float | float f float minimum float maximum float target |
Returns target if f is outside the range of minimum to maximum; otherwise returns f. |
| Name | Required Value | Description |
|---|---|---|
| TRACE_ENFLOAT | n/a | Enables trace logging (not used). |
enFloat calls no callback functions.
| Name | Description |
|---|---|
| CONST_FLOAT_SMALLEST | The smallest positive float (1.175494351E-38). |
| CONST_FLOAT_LARGEST | The largest positive float (3.402823466E+38). |
| CONST_FLOAT_PI_BY_FOUR | Pi divided by four (0.78539816339). |