← board

Transcendental math library (Sqrt/Sin/Cos/Ln/Exp/ArcTan/Power/Pi/Abs)

Scope

Pure-Pascal floating-point transcendentals in lib/rtl/math.pas (no libm — keeps the no-libc design): Pi, Abs(Double), Sqrt (Newton), Exp/Ln (range reduction + Taylor/atanh series), Sin/Cos (mod-2π reduction + Taylor), ArcTan (half-angle reduction + Taylor), Power(Double,Double) (= exp(e·ln b)). The existing integer Min/Max/Power/Gcd/Lcm are unchanged; float Power is an overload, float Abs is new.

Bugs found + handled along the way

Acceptance

test/test_math.pas exercises all functions; output byte-identical to FPC (uses math) at 8 decimals incl. the identity sin²+cos²=1. make test green.

Log