Boost logo

Boost :

Subject: Re: [boost] [fixed_point] First presentation from GSoC 2015 and more
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2016-10-17 05:10:56


> -----Original Message-----
> From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Michael Marcin
> Sent: 15 October 2016 17:13
> To: boost_at_[hidden]
> Subject: Re: [boost] [fixed_point] First presentation from GSoC 2015 and more
>
> 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: https://github.com/
> >>> johnmcfarlane/fixed_point/blob/master/doc/p0037.md#p0106

<snip>

> 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

Then you will note with approval that Christopher Kormanyos has implemented all the application C Math functions, which also allows
the much of the Boost.Math library to be used without further ado.
This is a tremendous advantage if you start with existing floating-point code and want to use it with fixed-point.

 A few examples are shown in the /examples folder, most spectacularly (though not specially usefully?) the Bernoulli numbers,
calculated at an extravagant precision.

(Using Boost.Math may mean that floating-point is used en route, but you can't make omelette without breaking eggs ? ;-) Similarly,
input/output uses floating point, but only if used, controlled by a macro, so suitable for bare-metal applications.).

A downside of using C math functions, internally and externally, is that these cannot portably be constexpr - yet. This means that,
despite marking constexpr, fixed-point cannot yet be made constexpr.
This seems an important attribute but must await changes to Standard and implementation of C++.

Paul

---
Paul A. Bristow
Prizet Farmhouse
Kendal UK LA8 8AB
+44 (0) 1539 561830

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk