PlagueDoctor Posted November 12, 2016 Posted November 12, 2016 Why is my code outputting this? Recently switched from eclipse to intelliJ, it was fine before i switched, haven't changed anything.. how do i fix it? Heres the code.
Botre Posted November 12, 2016 Posted November 12, 2016 Your value could overflowing, int can only store values up to 2^31 or 2,147,483,648. Show all involve variable declarations please.
Token Posted November 12, 2016 Posted November 12, 2016 Your value could overflowing, int can only store values up to 2^31 or 2,147,483,648. Show all involve variable declarations please. That's not something you want to fix... I wish my profit would exceed 31 bits 3
Botre Posted November 12, 2016 Posted November 12, 2016 That's not something you want to fix... I wish my profit would exceed 31 bits Could overflow for other reasons.
Hzkane Posted November 12, 2016 Posted November 12, 2016 You need to show us all the variables in your calculations, but personally I would do this instead of how you are calculating time ran. long timeRan = System.currentTimeMillis() - startTime; so this way when you're calculating profit/hr you don't have to have long unnecessary code. You can just do something along the lines of int profitPerHr = (int) (profit * 3600000d / timeRan); 1