Home

Awesome

ZKFloat

About

ZKFLoat library adds support for representing floating point values and performing a basic arythmetic operations over floating point numbers. The numbers are represented as a base 10 floating point values in format inspired by IEEE 754 format for representing floating points using base 2. The structure consists of a sign, mantissa and exponent. Due to a current lack of support for signed data types in Noir language, explicit representation of a sign value is required. Mantissa is represented using <i>p</i> number of significant digits, which equals 7 in the basic form but can be altered. As exponent value can also be negative values, current implementation uses exponent value centered around a specified positive value. In current value, the center value is 100, meaning that 0 exponent equals 100 in transformed format.

The library implements Float structure representing floating point values, as well as operations for addition, subtraction and multiplications of the values. Each operation keeps first <i>p</i> number of digits in mantissa and updates exponent value of the result when needed.

Implemented methods

Future work

Applications

The library is used in SKProof python library for proving execution of ML models