Boost logo

Boost :

Subject: Re: [boost] [review] The review of Boost.DoubleEnded starts today: September 21 - September 30
From: degski (degski_at_[hidden])
Date: 2017-10-08 12:14:15


On 28 September 2017 at 14:31, Paul A. Bristow via Boost <
boost_at_[hidden]> wrote:

> Boost has the floating-point constant phi
>
> http://www.boost.org/doc/libs/1_65_1/libs/math/doc/html/
> math_toolkit/constants.html
>

 Expressed as a ratio:

// The Golden Ratio, the ratio of the 2 largest consecutive Fibonacci
numbers
// representable in std::intmax_t...

#ifdef _WIN64
using golden_ratio = std::ratio<7540113804746346429, 4660046610375530309>;
#else
using golden_ratio = std::ratio<1836311903, 1134903170>;
#endif

Which makes the definition of the Golden Ratio independent of the
underlying (system defined) representation of reals, but the best possible.

degski

-- 
"*Ihre sogenannte Religion wirkt bloß wie ein Opiat reizend, betäubend,
Schmerzen aus Schwäche stillend.*" - Novalis 1798

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