https://github.com/navpreetdevpuri/base-2-n
To work with base 2^n numbers.
https://github.com/navpreetdevpuri/base-2-n
base16 base64 basen javascript math typescript
Last synced: about 1 month ago
JSON representation
To work with base 2^n numbers.
- Host: GitHub
- URL: https://github.com/navpreetdevpuri/base-2-n
- Owner: NavpreetDevpuri
- License: mit
- Created: 2023-03-16T08:24:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-31T08:22:39.000Z (about 3 years ago)
- Last Synced: 2025-03-18T00:13:04.750Z (about 1 year ago)
- Topics: base16, base64, basen, javascript, math, typescript
- Language: TypeScript
- Homepage:
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# base-2-n
To work with base 2^n numbers.
## Usage
```js
const a = new Base2N('\u0000', 2); // base 2
const b = new Base2N('\u0001', 2);
let c = a.add(b);
console.log(a.toString());
console.log(b.toString());
console.log(c.toString());
c = c.subtract(b);
console.log(c.toString() == a.toString()); // true
```