Giter Club home page Giter Club logo

soft-ieee754's Introduction

soft-ieee754

This is a software implementation of the ieee754 floating point format for any size with any configuration for exponent, mantissa and bias values, allowing you to create any size floating point format when unavailable by the hardware.

Notable examples are 'half-precision' floating points (also known as binary16) used in graphic processing hardware not available on modern CPUs, or needed for compact network transmission of floating points.

Why?

Most hardware today only supports 32bit (single precision) and 64bit (double precision) floating points in hardware, without support for other sizes that are useful when compactness is needed.

Status

Currently the library is capable of supporting almost correct arithmetic operations and is binary compatible with other floating point implementations of same requested size (for example, binary32).

Known bugs / missing features:

  • Algebraic functions are not implemented yet
  • Floating points larger than 64bit cannot be represented
  • Arithmetic operations with infinity results into incorrect results
  • Casting of ±NaN or ±Infinity into a signed or unsigned is incorrect

Testing

To compile the unit tests you'll need libgtest. To compile, run:

g++ -O2 -Iincludes -std=c++11 tests/*.cpp -lgtest -lgtest_main -lpthread -o soft-ieee754-test

Then run the executable soft-ieee754-test

soft-ieee754's People

Contributors

liranuna avatar firstlovelife avatar

Watchers

James Cloos avatar  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.