Player12
An open source football management simulator
Loading...
Searching...
No Matches
PortableMath Namespace Reference

Functions

double log (double x)
 
double exp (double x)
 
double cosTwoPi (double turns)
 

Detailed Description

Elementary functions built from IEEE-754 basic operations only (+, -, *, /, sqrt, frexp, ldexp, floor), which every platform rounds the same way. The C library's log, exp and cos may differ in the last bit between libstdc++/glibc, libc++/Apple and MSVC, which would make seeded draws platform dependent. Accurate to a few units in the last place.

Function Documentation

◆ cosTwoPi()

double PortableMath::cosTwoPi ( double  turns)
private

cos(2 pi turns) for turns in [0, 1).

◆ exp()

double PortableMath::exp ( double  x)
private

e to the power x (0 below -745, infinity above 709.78).

◆ log()

double PortableMath::log ( double  x)
private

Natural logarithm of x > 0.