https://github.com/hi2ma-bu4/bigfloat
JavaLibraryScriptから移植したBigFloatライブラリ
https://github.com/hi2ma-bu4/bigfloat
bigfloat javascript library typescript
Last synced: 1 day ago
JSON representation
JavaLibraryScriptから移植したBigFloatライブラリ
- Host: GitHub
- URL: https://github.com/hi2ma-bu4/bigfloat
- Owner: hi2ma-bu4
- License: apache-2.0
- Created: 2026-03-15T08:35:40.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-05-30T15:30:53.000Z (2 days ago)
- Last Synced: 2026-05-30T17:13:49.541Z (1 day ago)
- Topics: bigfloat, javascript, library, typescript
- Language: TypeScript
- Homepage: https://hi2ma-bu4.github.io/RepoShowcase/public/bigfloat/test/
- Size: 2 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BigFloat
[](https://github.com/hi2ma-bu4/BigFloat/blob/main/LICENSE)
[](https://github.com/hi2ma-bu4/BigFloat/releases/latest)
[](https://github.com/hi2ma-bu4/BigFloat/releases)
[](https://cdn.jsdelivr.net/gh/hi2ma-bu4/BigFloat/dist/BigFloat.js)
[](https://github.com/hi2ma-bu4/BigFloat)
[](https://github.com/hi2ma-bu4/BigFloat/blob/main/dist/BigFloat.js)
[](https://github.com/hi2ma-bu4/BigFloat/blob/main/dist/BigFloat.min.js)
[](https://github.com/hi2ma-bu4/BigFloat/blob/main/dist/BigFloat.d.ts)
JavaScript / TypeScript で高精度な浮動小数点演算を扱うためのライブラリです。
## 特徴
- 任意精度の四則演算、冪乗、対数、三角関数に対応
- `Infinity` / `-Infinity` / `NaN` を状態として扱う特殊値対応
- `BigFloatStream` による連続計算・集計 API を利用可能
[API一覧(自動生成)](./API.md)
## CDN
```txt
https://cdn.jsdelivr.net/gh/hi2ma-bu4/BigFloat/dist/BigFloat.js
```
## 基本例
```ts
import { bigFloat, BigFloat, BigFloatStream } from "BigFloat";
const value = bigFloat("1.234567890123456789", 80n)
.mul("3.5")
.div("7");
console.log(value.toString());
const root = BigFloat.from("2", 100n).sqrt();
console.log(root.toString());
const sum = new BigFloatStream([1, 2, 3, 4], 80n).sum();
console.log(sum.toString());
const special = bigFloat(1).div(0);
console.log(special.toString()); // Infinity
```
## 開発
```bash
npm install
npm run build
npm run test
```