Standalone ceil implementation for double
| 68 | |
| 69 | // Standalone ceil implementation for double |
| 70 | double ceil_impl_double(double value) { |
| 71 | if (value <= 0.0) { |
| 72 | return static_cast<double>(static_cast<long long>(value)); |
| 73 | } |
| 74 | long long i = static_cast<long long>(value); |
| 75 | return static_cast<double>(i + (value != static_cast<double>(i) ? 1 : 0)); |
| 76 | } |
| 77 | |
| 78 | // Standalone exp implementation using Taylor series |
| 79 | // e^x ≈ 1 + x + x²/2! + x³/3! + x⁴/4! + ... |
no outgoing calls
no test coverage detected