ts-calc icon indicating copy to clipboard operation
ts-calc copied to clipboard

compute with typescript type system

ts-calc

compute with typescript type system

image

📦 ts-calc is now integrated in HOTScript.

You can compute almost anything with typescript type system. Unlike most example out there that use number to tuple trick, this is using new typescript 4.8 feature to convert strings to numbers or bigint. This allows to arbitrary long number computations that tuple trick can't do. This code base implement number and bigint for the following type functions:

  • addition
  • negation
  • absolute value
  • subtraction
  • comparison
  • multiplication
  • division
  • modulo
  • power
  • factorial
  • range
  • fizzbuzz

enjoy!