Boost logo

Boost Users :

Subject: [Boost-users] Interval cos fails on 64 bits platforms
From: Christophe TROESTLER (Christophe.Troestler_at_[hidden])
Date: 2010-06-05 06:12:43


Hi,

I would like to use boost interval library in computer assisted
proofs. However my machines are mostly 64 bits and the attached
program fails -- returning [nan, nan] -- on them. On 32 bits, it
works fine. Since this bug seems to be known [1], may somebody tell
me how much progress has been done on solving it and whether there is
there a workaround available? Thanks.

Best,
Christophe

[1] https://svn.boost.org/trac/boost/ticket/2769
    https://svn.boost.org/trac/boost/ticket/4011


#include <boost/numeric/interval.hpp>
#include <fstream>
#include <iostream>

using namespace boost;
using namespace numeric;
using namespace interval_lib;

typedef interval<double,
                 policies<save_state<rounded_transc_opp<double> >,
                          checking_base<double> > > I;

template<class T, class Policies>
std::ostream &operator<<(std::ostream &os,
                         const boost::numeric::interval<T, Policies> &x) {
  os << "[" << x.lower() << ", " << x.upper() << "]";
  return os;
}

int main()
{
  std::cout << cos(I(-1, -0.6)) << "\n";
}


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net