S
S
Sergey Melodin2017-11-10 20:23:49
Mathematics
Sergey Melodin, 2017-11-10 20:23:49

Is there a formula for calculating working time?

I can not formulate a question for Google, how to call "time windows", so I ask for your help:
Let's say a person works exactly 8 hours, respectively, 16 hours of "rest". There is a time for the task, which is, for example, 40 hours. When working 8 hours a day, this will take 5 days, but not 120 hours (5 * 24), but 104 - five times 8 hours and 4 times 16 (8 + 16 + 8 + 16 + 8 + 16 + 8 + 16 +8).
Work for 8 hours will take, it turns out, not "one day", a multiple of days, but 8 hours, while 9 working hours will take 25 actual hours.
Actually, I started to reinvent the wheel, taking into account an even and an odd number, with if-else blocks ... well, I thought that maybe there is a normal mathematical solution "in one line".
Everything is suitable as an example - a description in words, links to Wikipedia, examples in PL (I understand php and js).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2017-11-10
@melodyn

For the ideal case - work every day strictly for 8 hours - the solution is the simplest.
But for real calculations, this, of course, is not suitable, if only because of weekends, holidays and postponements of holidays.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question