Boost logo

Boost Users :

From: Guillaume Melquiond (guillaume.melquiond_at_[hidden])
Date: 2007-03-15 06:25:03


Quoting Andreas Fabri:

> VC2005 on this hardware/OS can produce 32 bit code as well as 64 bit code.
> I just checked and can confirm that the macro _M_X64 is defined,
> whatever that means for you.
>
> "ANSI _controlfp (specifcally see the _MCW_RC mask) or
> numeric_limits::round_style,

numeric_limits::round_style could have been a good idea, but the linked
documentation explicitly says it doesn't work, so I'm not sure why it was
suggested to you.

_controlfp does help though (even if the documentation says it's deprecated).
The documentation does not say whether it's an alias for _control87 or not. If
it is, you just have to add "|| defined(_M_X64)" at hw_rounding.hpp:28.
If this is not sufficient, you also have to change all the occurrences of
_control87 by _controlfp in the detail/msvc_rounding_control.hpp file. You can
check your changes by verifying that the following testcase displays "Rounded
outwards".

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

int main() {
  volatile double a = 1, b = 3;
  boost::numeric::interval<double>
    ia = double(a), ib = double(b), ic = ia / ib;
  bool ok = width(ic) > 0;
  std::cout << (ok ? "Rounded outwards\n" :
                     "Rounded strangely\n");
  return !ok;
}
//-----------------------------------------------

> I also have the Intel 9 compiler for (32 bit) Windows. Let me know when you
> want me to check something for you.

Please try the testcase with this compiler too.

Best regards,

Guillaume


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