RichU64String.toU64Long "parses" single digit negative numbers
See original GitHub issueThis is extremely unimportant and may even “not a bug”, but I was surprised when I did:
val longVal = "-1".toU64Long
In this case, longVal
is 255
. Seems to me like this should probably throw NumberFormatException
, since it isn’t a valid unsigned 64-bit string? Other example values that return numbers:
-f -f00 10-f00
I’m happy to submit a patch if that makes sense.
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to parse string containing negative number by j2me api?
I can do it by Integer.parseInt() and Float.parseFloat() after splitting. But I can't do it for negative number. It throws exception java.
Read more >Adding & subtracting negative numbers (video) - Khan Academy
Learn how to add and subtract negative numbers. ... Does it matter if the negative number is bigger than the positive one ?...
Read more >Ordering negative numbers (article) | Khan Academy
Extend the idea of greater than and less than to negative numbers! We already know that numbers farther to the right on the...
Read more >Negative number - Wikipedia
In mathematics, a negative number represents an opposite. In the real number system, a negative number is a number that is less than...
Read more >Pass negative number as command line argument
Is there a way to pass a negative number as an option or command line argument to ArgumentParser? For example, the code below...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh yeah me too. I think I filed this before I knew how anything worked at Twitter. Thanks!
@mirokuratczyk good point! totally forgot he had already fixed it, thanks @evanj!