Last active
May 23, 2016 23:28
-
-
Save Marzogh/1cc67d172b9344ea331974df4e9df85a to your computer and use it in GitHub Desktop.
Calculates change between numbers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int getValueChange(int currVal, int lastVal) { | |
if (currVal > lastVal) { | |
return (currVal - lastVal); | |
} else { | |
int dec = -(lastVal - currVal); | |
return dec; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment