An open API service indexing awesome lists of open source software.

https://github.com/ecyrbe/ts-calc

compute with typescript type system
https://github.com/ecyrbe/ts-calc

Last synced: about 1 year ago
JSON representation

compute with typescript type system

Awesome Lists containing this project

README

          

# ts-calc
compute with typescript type system

![image](https://user-images.githubusercontent.com/633115/191343386-25f854d8-bdb3-43ba-9837-5a48d7ee5e77.png)

📦 ts-calc is now integrated in [HOTScript](https://github.com/gvergnaud/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!