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

Avoid locale sensitive std::stof function #24

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rsxrwscjpzdzwpxaujrr
Copy link

@rsxrwscjpzdzwpxaujrr rsxrwscjpzdzwpxaujrr commented Aug 12, 2019

std::stof function's decimal separator is defined in locale (in LC_NUMERIC), and it may vary depending on chosen locale, which leads to loss of fraction in all floating-point numbers when using different locale (i.e in russian comma is used instead of a dot). I made li_stof function that is independent from locale. It always uses dot as a decimal separator, and does not change the locale.

Also added some minor fixes, maybe fixing #22.

incredibleLeitman added a commit to incredibleLeitman/OBJ-Loader that referenced this pull request Feb 12, 2021
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

Successfully merging this pull request may close these issues.

1 participant