Boost logo

Boost :

Subject: Re: [boost] [fixed_point] First presentation from GSoC 2015 and more
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2016-10-15 12:12:41

On 10/14/2016 12:11 PM, John McFarlane wrote:
>>> I discuss P0106R0 (a revision to N3352) in my paper, the latest draft of
>>> which is always available here:
>>> johnmcfarlane/fixed_point/blob/master/doc/

I once wrote and shipped a fixed-point software renderer. Granted that
was about 9 years ago.

There has been a great deal of discussion of fixed-point libraries over
the years on the the boost devel list going back to at least 2007. I
hope you've taken the time to explore the archives.
For example:

I read through P0106R0 but I came away feeling I knew almost nothing
about what the actual implementation would be.

I looked around the code and documentation on github as well. After
about 30 minutes it started to make some sense and looks pretty nice.
I couldn't figure out answers to some basic questions.

How does division work? Does it promote 32 -> 64 before division?
Does mixed fixed arithmetic work? i.e. s16.16 * s24.8?
Is the result of an operation necessarily the same as the operands?
  - For example its sometimes useful to do s16.16 * s16.16 -> s24.8.
How does one convert between different fixed-point representations?
How does one convert raw fixed-point integers <-> fixed-point class?

Note: the doxygen documentation for convert to float operator does not
say it's explicit, that worried me greatly but I saw it is marked as
explicit in the code.

I can't find the numeric_limits specialization.

I can't find the cmath functions.
At least a subset was crucial for my past work:
  * abs
  * fmod
  * floor
  * ceil
  * sqrt
  * cos
  * sin
  * atan2

I never did get a generic trig functions implementation.
IIRC our implementation used lookup tables and CORDIC algorithm for just
a handful of formats.

Boost list run by bdawes at, gregod at, cpdaniel at, john at