Closed DanielBaumert closed 1 year ago
That's a check for whether 0-9 are consecutive in the current character set. 0-9, A-Z and a-z are consecutive in everything ASCII-based, i.e. on pretty much everything, but there are a few older computer systems where they're not. https://en.wikipedia.org/wiki/EBCDIC#Code_page_layout
But the C++ spec demands that 0-9 are consecutive, so it's a rather unnecessary check. https://eel.is/c++draft/lex.charset "The code unit value of each decimal digit character after the digit 0 (U+0030) shall be one greater than the value of the previous." (A-Z and a-z are not required to be consecutive.)
@Alcaro Thanks for the information, it seems I was over-cautious. Let's remove it then.
Hello :D
Can you briefly explain why you do these checks? https://github.com/jk-jeon/dragonbox/blob/34a6cdf99d4afe18008877627dabe1f5bf238e1a/source/dragonbox_to_chars.cpp#L80-L82