Jump to content

... per hour giving negative ammount?


blabla123

Recommended Posts

 

 

He can hold planksPerHour as integer, there's no need for long, as it won't even exceed 2k.

Also, he doesn't need to reverse order, if he changed the number to double. (3600000.0) or (3600000d).

The resulting double will be converted back to integer without any problems.

int planksPerHour = (int)(3600000d * planksCreated  / System.currentTimeMillis() - startTime);

 

Well, if you want to be more efficient:

short planksPerHour = (short)(3600000d * planksCreated / System.currentTimeMillis() - startTime);
Link to comment
Share on other sites

 

Well, if you want to be more efficient:

short planksPerHour = (short)(3600000d * planksCreated / System.currentTimeMillis() - startTime);
veryshort planksPerHour = (veryshort)(3600000d * planksCreated / System.currentTimeMillis() - startTime);

trollface_trollface-555px.png

 

 

Your short actually wouldn't work if he started the script and crafted items instantly // for many scripts

Edited by Nitrousek
  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...