Created
March 3, 2018 00:58
-
-
Save CennoxX/95b549d7a9f2f03e35be84e5b600f6ef to your computer and use it in GitHub Desktop.
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
m(x) ... minutes of the time x | |
h(x) ... hours of the time x | |
add time | |
a+b=c | |
if (m(c)>=60) || (h(a)+h(b)>h(c)) | |
c=c+40 | |
subtract time | |
a-b=c | |
if (m(a)<m(b)) //includes if m(c)>=60 | |
c=c-40 | |
example | |
5:30+2:40h | |
calculate 530+240=770 | |
m(770)=70; 70>=60 | |
770+40=810 | |
calculated time 8:10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment