Skip to content

daamath

daamath is a cross-language math library specification, with implementations in various programming languages:

python python -m pip install daamath

examples

import daamath as dm

sin = dm.sin.binary64.nearesteven
pi = dm.archimedes.binary64.nearesteven
approx = dm.tilde_tilde

print(dm.ellinika.lower.pi, approx, pi)
# π ≈ 3.141592653589793

print(sin(pi), approx, 0)
# 1.2246467991473532e-16 ≈ 0

features

it provides four useful things in math:

  • characters: +, −, ×, ÷, =, %, …
  • constants: π, e, φ, √2, i, γ, …
  • datatypes: binary64, int32, uint8, bool, complex128, decimal64, …
  • functions: sin, log, abs, pow, sqrt, round, …

since it must behave the same in different programming languages, it has some rules:

to do

  • ≈ 25 / 100 math constants implemented
  • rename each constant's nearest and residual to nearesteven and residual
  • document datatypes
  • analyze numerically favourable formulae for complex trig functions
  • explore unicode for more interesting characters