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

doesnt work on windows / visual studio #1

Closed
peterritter opened this issue Apr 9, 2016 · 4 comments
Closed

doesnt work on windows / visual studio #1

peterritter opened this issue Apr 9, 2016 · 4 comments

Comments

@peterritter
Copy link

Hi

I tried to use your library on MS-Windows in my visual studio project. I copied over the files into my project. I got some compiler warnings - not sure if they are serious or not.

However, when running a simple conversion I get an infinite loop here:

        while (!(m_f & hidden_bit<original_matissa_bit_width>()))
        {
            m_f <<= 1;
            m_e--;
        }

its line 126 in diy_fp.h

The code I am trying to run is:

    char buffer[128];
    double num = 55.6666;
    floaxie::ftoa(num, buffer);

Has your code ever been run on windows at all?

thanks Peter

@aclex
Copy link
Owner

aclex commented Apr 10, 2016

Thanks for trying my project, Peter. Didn't even think anyone but me used it.

In fact it wasn't thoroughly tested on Windows, but I just tested this use case there, and it's apparently a bug which GCC just forgives.

There should be:
while (!(m_f & hidden_bit<original_matissa_bit_width - 1>()))
but roundtrip test fails with this. So, you can just hotfix it for you this way while I'm looking deeper into it to find a proper fix.

@aclex aclex closed this as completed in bc359cf Apr 10, 2016
@aclex
Copy link
Owner

aclex commented Apr 10, 2016

Peter, I've just pushed a fix for this, it's indeed something that VS warned of. Many thanks for the reporting!

@peterritter
Copy link
Author

Hi Alexey

Thanks for fixing this. I am using a heavily modified version of the json11 library by dropbox. They have a bug in there which makes floating point conversion locale dependent. So I was trying to fix this in my version. After problems with your code I lifted the code from the rapidjson project. Sorry about that. You never know if people respond to bug reports right away.

Are you a software consultant? If so, send me an email at ritter.pet@gmail.com

best Regards, Peter

@aclex
Copy link
Owner

aclex commented Apr 11, 2016

Yes, no problem) I used and looked at rapidjson code quite thoroughly and it just worked flawlessly for me, so I hope it would help you, too.
In fact, this project is also started because of number parsing in JSON library, another my project, Peli (https://github.com/aclex/peli). I wish I could suggest it to you, but I'm afraid it's currently not production ready, too. I'm a little bit stuck with atof-part of floaxie, sort of created a special algorithm for it, and it's always tricky thing.

I'm actually not a software consultant, just a developer, but if you have any questions concerning this field, feel free to ask at 4ernov@gmail.com.

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