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
- Host: GitHub
- URL: https://github.com/ecyrbe/ts-calc
- Owner: ecyrbe
- License: mit
- Created: 2022-09-07T00:26:55.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-10T09:49:12.000Z (over 3 years ago)
- Last Synced: 2025-02-25T07:08:09.368Z (over 1 year ago)
- Language: TypeScript
- Size: 16.6 KB
- Stars: 57
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ts-calc
compute with typescript type system

📦 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!