Giter Club home page Giter Club logo

cubit's Introduction

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.

cubit's People

Contributors

clexmond avatar ftupas avatar tarrencev avatar tensojka avatar 0xsachaeth avatar ametel01 avatar evolveart avatar ponderingdemocritus avatar whatthedev-eth avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.