#Calculator Troubleshooting

7 messages · Page 1 of 1 (latest)

little hemlock
#

Right so I made a program that's a calculator. After getting help for something else I went on my day but after troubleshooting it for a bit I found that I'd get an answer that I don't think I should get. Usually 46340*50000 is 2,317,000,000 and not a negative number (Like what's returned here), correct? I think it's because the long data type (Which is used here) can't store it though, would I be right? Or is it due to something else

tranquil orioleBOT
#

This post has been reserved for your question.

Hey @little hemlock! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

little hemlock
royal field
#

you can read long value from input. scan.nextLong() and assign to long variables

little hemlock
#

Since I don't think there's a structural difference between them besides how much they can hold and I'll be using bigger numbers