Skip to main content

PyPI version

Cairo Math 64x61

A fixed point 64.61 math library for Cairo & Starknet.

Usage

Install with pip install cairo_math_64x61 and import and use with from cairo_math_64x61.math64x61 import Math64x61. Previous installation as an npm module has been deprecated, the last available npm module is v1.2.0. Starting with v2.0.0 the library utilizes Cairo 0.10 syntax and simplifies return values from objects to simple felts wherever possible.

Signed 64.61 Fixed Point Numbers

A signed 64.61-bit fixed point number is a fraction in which the numerator is a signed 125-bit integer and the denominator is 2^61. Since the denominator stays the same there is no need to store it (as in a floating point value).

64.61 is utilized as the 125 bit representation allows for overflow up to 2^125 * 2^125 (250 bits) during calculation taking advantage of Cairo's 251 bit felts.

Can represent values in the range of -2^64 to 2^64 with precision to 4.34e-19.

Standard Library

Math64x61 includes implementation of add, sub, mul, div, sqrt, exp, ln, log2, log10, and pow as well as conversion to / from felts and Uint256 values, floor, ceil, min, max and assertion methods.

Trigonometry Library

Trig64x61 includes implementation of sin, cos, tan and their inverses.

Hyperbolic Library

Hyp64x61 includes implementation of sinh, cosh, tanh, and their inverses.

Vector Library

Vec64x61 includes implementation of vector arithmetic (add, sub, div), dot product (dot), cross product (cross) and norm.

Metadata

Release files for cairo-math-64x61 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cairo-math-64x61 2.1.1
File Size Uploaded
cairo_math_64x61-2.1.1.tar.gz 9.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cairo-math-64x61 2.1.1
File Interpreter ABI Platform
cairo_math_64x61-2.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.9 kB

Release files / cairo_math_64x61-2.1.1.tar.gz

Download URL cairo_math_64x61-2.1.1.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3675003fd0eb7048e999715acde23ae5cd7446a978c1761fe46f18624ca428f8
BLAKE2b-256 checksum
How to use checksums
196b2e8db64ad630274e8b930a55d7d7b207b202c5054073e513eca4fd200934
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / cairo_math_64x61-2.1.1-py3-none-any.whl

Download URL cairo_math_64x61-2.1.1-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78736be3ca41f15f956fa7370a9961307dde0bf3bf43ec3cbd29c78f188c56d3
BLAKE2b-256 checksum
How to use checksums
25ccf5d12b173d808e179a2223d2a79e0a4ff709afeed4ef1b113e829708a0fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

2.1.1 This release

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page