We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is a problem w/ the double conversion if TOTAL_WIDTH and FRACTION_WIDTH is equal and Fi::SIGNED. Considering
TOTAL_WIDTH
FRACTION_WIDTH
Fi::SIGNED
#include "fi/Fixed.hpp" #include "fi/overflow/Wrap.hpp" //#include <boost/shared_ptr.hpp> int main(int argc, char* argv[]) { const double val(0.1); Fi::Fixed<16, 16, Fi::SIGNED> a(val); Fi::Fixed<16, 15, Fi::SIGNED> b(val); Fi::Fixed<16, 16, Fi::SIGNED> c("0.1"); std::cout << "Fi::Fixed<16, 16, Fi::SIGNED> a(0.1) does not work: " << a << std::endl; std::cout << "Fi::Fixed<16, 15, Fi::SIGNED> b(0.1) works: " << b << std::endl; std::cout << "Fi::Fixed<16, 16, Fi::SIGNED> c(\"0.1\") works: " << c << std::endl; return 0; }
yields
Fi::Fixed<16, 16, Fi::SIGNED> a(0.1) does not work: -0.100006103515625 Fi::Fixed<16, 15, Fi::SIGNED> b(0.1) works: 0.0999755859375 Fi::Fixed<16, 16, Fi::SIGNED> c("0.1") works: 0.0999908447265625
I'm using GCC 4.7.2 and Boost 1.57.0.
The text was updated successfully, but these errors were encountered:
67bab3b
Thanks for finding this bug.
Sorry, something went wrong.
gsarkis
No branches or pull requests
There is a problem w/ the double conversion if
TOTAL_WIDTH
andFRACTION_WIDTH
is equal andFi::SIGNED
. Consideringyields
I'm using GCC 4.7.2 and Boost 1.57.0.
The text was updated successfully, but these errors were encountered: