Boost logo

Boost :

Subject: Re: [boost] [Units] test_trig fails on Sandia-darwin-4.4 (caused by compile-time evaluation of math functions)
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2011-08-23 05:27:38


> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of Mathias
> Gaunard
> Sent: Sunday, August 21, 2011 3:56 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] [Units] test_trig fails on Sandia-darwin-4.4 (caused by compile-time
evaluation of
> math functions)

<snip>

> I don't know what BOOST_CHECK_CLOSE_FRACTION does,

It allows an 'approximately equal' check, with a tolerance, usually an epsilon or two for built-in
functions.

BOOST_CHECK_CLOSE_FRACTION(v1, v2, std::numeric_limits<double>::epsilon());

Using exact comparison (BOOST_CHECK) is always dodgy for floating point.

> but I don't think there is any guarantee at all about the accuracy of the standard mathematical
functions.

Definitely not, especially for corner cases.

Paul

---
Paul A. Bristow,
Prizet Farmhouse, Kendal LA8 8AB  UK
+44 1539 561830  07714330204
pbristow_at_[hidden]

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