C++ fixed-point math is proposed

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

GitHub - johnmcfarlane/cnl: A Compositional Numeric Library for C++

CNL is a numerics library written in C++ which aims to do for int what the STL does for arrays. Its main roles are to help:

  • approximate real numbers using fixed-point arithmetic;
  • detect and prevent overflow and
  • increase precision through alternative rounding modes.

...

[use cases: simulations (games, models), embedded, mobile, GPU, FPGA]

...

[C++ proposals]

 

...

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

from a read of it :

  • required are GCC 5.1 or clang 3.5 or Visual Studio 2017
  • CNL is headers

 

CNL is more flexible than fixed-point in the Embedded C standard.

CNL adds to C++ the fixed-point that's in SystemC and also in Ada from its get go (1983)

 


due to

The Embedded Muse 361

http://www.ganssle.com/tem/tem361.html#toolsandtips

...

Readers contributed ideas about fixed-point math last issue, and John Lagerquist had some thoughts:

 

Here is an up and coming fixed point library that shows a lot of promise for C++ users:  https://github.com/johnmcfarlane/cnl

The author claims: The library's APIs are developed in collaboration with standardization bodies such as The C++ Standards Committee and members of The Khronos Group Inc. and it serves as a reference implementation for sections of the C++ Numbers Technical Specification

...

Embedded C

SystemC

Ada Overview - Ada Resource Association

 

Edits: typo, target

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Tue. Nov 6, 2018 - 09:56 PM