# Fun with BigInts!

**URL:** https://forum.makecode.com/t/fun-with-bigints/19975
**Category:** Show & Tell
**Tags:** extension
**Created:** [May 15, 2023, 6:21pm UTC](https://forum.makecode.com/t/fun-with-bigints/19975 "2023-05-15T18:21:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [May 15, 2023, 6:21pm UTC](https://forum.makecode.com/t/fun-with-bigints/19975/1 "2023-05-15T18:21:02Z")

</div>

This might be the most computer science-y thing that I’ve done in a very long time!

You may be familiar with a limitation of the floating-point `number` data type that is used in TypeScript. While 64 bits is a lot of room to hold most numbers that we encounter on a regular basis, it’s still a finite amount of room. When you start working with, say, cryptography or big hash functions that use really big numbers, you start to hit the limits of the `number` data type. To work around these limitations, special libraries are created to hold these large numbers.

Enter BigInt for MakeCode! I ported a portion of Google’s JavaScript (it’s actually written in TypeScript) library for BigInt (a.k.a. JSBI).

> **[GitHub - robo-technical-group/pxt-arcade-bigint: Port of the BigInt JavaScript library](https://github.com/robo-technical-group/pxt-arcade-bigint)**
>
> Port of the BigInt JavaScript library

You can see the extension in action here:

> **[Hello, BigInt!](https://arcade.makecode.com/08826-78382-70909-84675)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Now, you may ask, why did I do this? Mwah ha ha ha ha…

> [@What to do with large data files?](https://forum.makecode.com/t/what-to-do-with-large-data-files/12571/1):
>
> Wanted to get some opinions, particularly from the devs, on a rather ridiculous idea that I have. I’ve been thinking about word games lately, and I found myself down a rabbit hole this weekend. I thought, “what about a generic word lookup extension?” So, I created a proof of concept: The program works just fine in a browser. The data file contains the entire YAWL (“Yet Another Word List”) with some 200,000+ entries. The data file itself is about 5 MB on my file system. In contrast, the word …

If you find any bugs or want any additional features, then please let me know, either here or in GitHub. Feel free to file issues and pull requests there. Have fun!

---

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [May 15, 2023, 8:09pm UTC](https://forum.makecode.com/t/fun-with-bigints/19975/2 "2023-05-15T20:09:59Z")

</div>

Oh of course … _now_ I find this:

> **[GitHub - MikeMcl/big.js: A small, fast JavaScript library for...](https://github.com/MikeMcl/big.js)**
>
> A small, fast JavaScript library for arbitrary-precision decimal arithmetic. - GitHub - MikeMcl/big.js: A small, fast JavaScript library for arbitrary-precision decimal arithmetic.

So many rabbit holes! Looks like I’ll be creating a version two of this library! 😃 Be on the lookout for `namespace BigNums` in the near future! Not sure how useful an arbitrary-precision floating point number will be, but why not!

---

<div class="post-metadata">

### Author: ![EminentCastle77](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/eminentcastle77/32/22783_2.png) [@EminentCastle77](https://forum.makecode.com/u/EminentCastle77)
#### Post date: [May 16, 2026, 4:22am UTC](https://forum.makecode.com/t/fun-with-bigints/19975/3 "2026-05-16T04:22:03Z")

</div>

Yes! I needed this
