Skip to content

Instantly share code, notes, and snippets.

@romanitalian
Created October 9, 2016 09:22
Show Gist options
  • Save romanitalian/1dfa7ad8e94415d0f168f71f43b71266 to your computer and use it in GitHub Desktop.
Save romanitalian/1dfa7ad8e94415d0f168f71f43b71266 to your computer and use it in GitHub Desktop.
Как одной математической формулой по номеру месяца посчитать количество дней в нем?
function f(x) { return 28 + (x + Math.floor(x/8)) % 2 + 2 % x + 2 * Math.floor(1/x); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment