question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RichU64String.toU64Long "parses" single digit negative numbers

See original GitHub issue

This 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:closed
  • Created 9 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
evanjcommented, Jun 27, 2016

Oh yeah me too. I think I filed this before I knew how anything worked at Twitter. Thanks!

0reactions
mosesncommented, Jun 27, 2016

@mirokuratczyk good point! totally forgot he had already fixed it, thanks @evanj!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found