This issue and milestone are for the @type/math package that will be featured in the monorepo (see #1 et al).
@type/math will include several submodules that allow you to perform standard arithmetic operations including addition, subtraction, multiplication, division, etc. It will also feature some relational comparisons like greater than, etc.
The key feature of this package, which is also an underlying objective of most all of the packages in this repository, will be that the runtime utilities will be accompanied by a compile-time implementation. This means performing arithmetic operations at a purely type-level, with equivalent types for each runtime function.
This will allow you to do cool shit like this:
import { add, subtract, multiply } from "jsr:@type/math";
const sum = add(400, 20);
// ^? const sum: 420
const diff = subtract(420, 351);
// ^? const diff: 69
const product = multiply(42, 100);
// ^? const product: 4200
Yup, hovering over any of those variable names will show you a preview of the expected runtime output of each function, without ever leaving your editor (and without running any code!)
This issue and milestone are for the
@type/mathpackage that will be featured in the monorepo (see #1 et al).@type/mathwill include several submodules that allow you to perform standard arithmetic operations including addition, subtraction, multiplication, division, etc. It will also feature some relational comparisons like greater than, etc.The key feature of this package, which is also an underlying objective of most all of the packages in this repository, will be that the runtime utilities will be accompanied by a compile-time implementation. This means performing arithmetic operations at a purely type-level, with equivalent types for each runtime function.
This will allow you to do cool shit like this:
Yup, hovering over any of those variable names will show you a preview of the expected runtime output of each function, without ever leaving your editor (and without running any code!)