npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@influenceth/cubit

v1.0.0

Published

Fixed point math for Cairo and Starknet

Downloads

1

Readme

Cubit

Workflow Tests Status License: MIT

A fixed point math library in 64.64 and 32.32 representation built for Cairo & Starknet. Successor to influenceth/cairo-math-64x61

Cubit is currently a WORK IN PROGRESS and should not be used in production (yet). Contributions are welcomed.

Usage

Cubit was built with auditless/cairo-template, reference its installation guide to install dependencies.

Signed Fixed Point Numbers

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

64.64 (f128) values can represent values in the range of -2^64 to 2^64 with precision to 1e-20. 32.32 (f64) values can represent vlaues in the range of -2^32 to 2^32 with precision to 1e-9.

Core Library

All libraries in Cubit are referenced via the core type first, either cubit::f64 or cubit::f128.

Within each library, the following functions are available: core includes the following implementations for the Fixed type:

  • Add (+)
  • AddEq (+=)
  • Sub (-)
  • SubEq (-=)
  • Mul (*)
  • MulEq (*=)
  • Div (/)
  • DivEq (/=)
  • PartialEq (==, !=)
  • PartialOrd (>, >=, <, <=)
  • fixed.ceil
  • fixed.exp
  • fixed.floor
  • fixed.ln
  • fixed.log2
  • fixed.log10
  • fixed.pow
  • fixed.round
  • fixed.sqrt

trig includes precise and fast versions of the following trigonometric functions:

  • fixed.cos
  • fixed.cos_fast
  • fixed.sin
  • fixed.sin_fast
  • fixed.tan
  • fixed.tan_fast
  • fixed.acos
  • fixed.acos_fast
  • fixed.asin
  • fixed.asin_fast
  • fixed.atan
  • fixed.atan_fast

License

MIT © Unstoppable Games, Inc.