fp 0.1.1 Yanked

Cairo Fixed Point Arithmetics for your smart-contracts

Readme

Cairo Fixed Point Arithmetic

Uses 124 bit for integer part and 128 for fractional and packs everything in one felt252


Report a Bug - Request a Feature - Ask a Question

About

This crate was born in an effort to create fixed point datatype for Ekubo Protocol governance. It's specifically taiored to be used in smart-contracts. This library features:

  • Fixed Point datatype that supports operations: multiplication, division, addition and substraction.
  • Data packing and unpacking for smart contract storage.
  • Overflow and underflow checking for all operations.
  • Additional convenince methods for better performance without conversions such as u64 by u128 division method.
  • Conversion from u64, u128 and u256 types.
  • Rounding implementation.

Usage

To use the lib

Metadata

Version 0.1.1

Uploaded 1 day ago

License MIT-3.0

Size 170.7 KB

Installation

Run the following command in your project dir

scarb add fp@0.1.1

Or add the following line to your Scarb.toml

fp = "0.1.1"

Monthly downloads

Links

Repository github.com/carbonable-labs/carbon-protocol-v3

Documentation github.com/baitcode/cairo-fixed-point-arithmetic

Keywords

  • starknet
  • fixed point
  • math
  • division
  • smart contracts

Owners