Skip to content

Instantly share code, notes, and snippets.

@wtsnjp
Created August 15, 2019 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wtsnjp/e055c3c2b0c137e470c9f7b73483ab79 to your computer and use it in GitHub Desktop.
Save wtsnjp/e055c3c2b0c137e470c9f7b73483ab79 to your computer and use it in GitHub Desktop.
\catcode`\@=11
\def\esum#1{\the\numexpr\x@esum{#1}\relax}
\def\x@esum#1{%
\ifnum#1<\tw@\z@\else
\expandafter\x@esum\expandafter{\numexpr#1-\tw@\relax}+#1\fi}
\esum{100}\bye
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment