Skip to content

Single header file C++ library that provides IEEE 754 floating point types.

Notifications You must be signed in to change notification settings

kkimdev/ieee754-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

IEEE 754 Types

This is a single header file C++ library that provides IEEE 754 floating point types. Example usage:

#include <iostream>
#include "ieee754_types.hpp"

int main() {
  IEEE_754::_2008::Binary<32> x = 1.0;
  IEEE_754::_2008::Binary<64> y = 2.0;

  std::cout << x + y << std::endl;

  // Compile time error if the requested type doesn't exist in the system.
  // IEEE_754::_2008::Binary<16> z;
}

The type provided by this library IEEE_754_2008_Binary<n> is guaranteed to be IEEE 754 floating point, and it won't compile if the requested type is not available in the system.

For more details, please refer to this blog article IEEE 754 Floating Point Type in C++ .

About

Single header file C++ library that provides IEEE 754 floating point types.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages