OpenTTD Source
20241121-master-g67a0fccfad
|
Math functions. More...
Go to the source code of this file.
Functions | |
int | DivideApprox (int a, int b) |
Deterministic approximate division. More... | |
uint32_t | IntSqrt (uint32_t num) |
Compute the integer square root. More... | |
Math functions.
Definition in file math_func.cpp.
int DivideApprox | ( | int | a, |
int | b | ||
) |
Deterministic approximate division.
Cancels out division errors stemming from the integer nature of the division over multiple runs.
a | Dividend. |
b | Divisor. |
Definition at line 22 of file math_func.cpp.
References abs().
uint32_t IntSqrt | ( | uint32_t | num | ) |
Compute the integer square root.
num | Radicand. |
Definition at line 42 of file math_func.cpp.