boostorg / boostorg/multiprecision
Wrong division result with cpp_dec_float
- Dominant language
- C++
- Stars
- 265
- Forks
- 128
- Avg merge
- 4h 48m
- Merged PRs (30d)
- 2
Description
I'm using cpp_dec_float to don't deal on rounding issues when mathematic operations give some results with an exact base-10 representation. The result of 69000 / 184 = 375. With cpp_dec_float, it is a bit more.
```cpp
#include
#include
using decimal = boost::multiprecision::number,
boost::multiprecision::et_off>;
int main (int argc, char* argv[])
{
decimal a = decimal {"69000"} / decimal {"184"};
decimal b = ceil (a);
std::cout << "a = " << a << std::endl;
std::cout << "b = " << b << std::endl;
return 0;
}
```
The above program shows:
> a = 375
> b = 376
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.