Skip to content
New issue

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

Invalid template parameters when using toward_minus_infinity and toward_plus_infinity #26

Closed
mrmixer opened this issue Feb 24, 2022 · 1 comment

Comments

@mrmixer
Copy link

mrmixer commented Feb 24, 2022

Trying to compile the following code, I get an error on line 2058, where the second parameter passed to divide_by_pow10 is significand_bits + kappa + 2 instead of carrier_uint or something similar. I also assume the 3rd parameter isn't the correct value.

#include "dragonbox.h"

int main( int argc, char** argv ) {
    
    float x = 1.234f;   
    auto v = jkj::dragonbox::to_decimal( x, jkj::dragonbox::policy::decimal_to_binary_rounding::toward_plus_infinity );
    return 0;
}

Compiling with MSVC: cl -nologo main.cpp -Fe:dragonbox.exe -Zi -Od -std:c++17

@jk-jeon
Copy link
Owner

jk-jeon commented Feb 24, 2022

Thanks a lot for catching this!
Fixed in 02059bd.
Now v is set to be {12339999, -7}.

@jk-jeon jk-jeon closed this as completed Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants