xman / universal

Universal Number Arithmetic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

universal

Universal Number Arithmetic

How to build

The universal numbers software library is built with cmake. Install the latest cmake cmake.

The library is a pure template library without any further dependencies.

Now we are ready to build the universal library.

> git clone https://github.com/stillwater-sc/universal
> cd universal/build
> cmake ..
> make
> make test

Background information

Universal numbers, unums for short, are for expressing real numbers, and ranges of real numbers. There are two modes of operation, selectable by the programmer, posit mode, and valid mode.

In posit mode, a unum behaves much like a floating-point number of fixed size, rounding to the nearest expressible value if the result of a calculation is not expressible exactly. A posit offers more accuracy and a larger dynamic range than floats with the same number of bits.

In valid mode, a unum represents a range of real numbers and can be used to rigorously bound answers much like interval arithmetic does.

The unum format is a public domain specification, and there are a collection of web resources that manage information and discussions around the use of unums.

Posit Hub

Unum-computing Google Group

Goals of the library

This library is a bit-level arithmetic reference implementation of the evolving unum III (posit and valid) standard. The goal is to provide a faithful posit arithmetic layer for any C/C++/Python environment.

As a reference library, there is extensive test infrastructure to validate the arithmetic, and there is a host of utilities to become familiar with the internal workings of posits and valids.

We want to provide a complete unum library, and we are looking for contributors to finish the Type I and II unum implementations.

Contributing to universal

We are happy to accept pull requests via GitHub. The only requirement that we would like PR's to adhere to is that all the test cases pass, so that we know the new code isn't breaking any functionality.

About

Universal Number Arithmetic

License:MIT License


Languages

Language:C++ 98.9%Language:CMake 0.9%Language:C 0.2%