Edge Python
Esc

Go to

Commands

Sign In

Sign in to publish packages and pin them by sha256.


By continuing, you accept our Terms and Conditions.

@
Palette

math

0.1.0

Python's math functions, exact where Python is exact.

@dylan·0 downloads·166.1 KB·needs edge 0.7.3·Repository
edge add math && edge lock
bash

sha256-b31c6c684e74922b0b573b3da03cc44a0eb5ecb227d57b083946a8275aa97a86

Docs

math

math works like Python’s. It holds the constants, the float functions, the integer functions and the exact sums, and fsum, hypot and dist give Python’s results to the last bit.

1.4142135623730951 3.141592653589793
13.0 5.0
2 3 -2
Output

The integer functions take ints and stay exact, and prod keeps a product of ints an int.

2432902008176640000 120 20
6 12 9
24 2.0
Output

fsum adds exactly and rounds once, isclose compares within a tolerance, and modf and frexp split a float into a tuple.

0.6000000000000001 0.6
True True
(0.75, 3.0) (0.75, 4)
Output

A value outside a function’s domain raises ValueError, and a result too large for a float raises OverflowError. Ints hold 128 bits in Edge, so an integer result past that, such as factorial(34), raises OverflowError too. nextafter, ulp and sumprod are not supported.

ValueError math domain error
OverflowError math range error
Output

Versions

VersionPublishedSize
0.1.0currentSeptember 28, 2026166.1 KB