samuelmarina / is-even

Is a number even?
1.85k stars 193 forks source link

Add support for Graham's number #258

Open mihaitodor opened 1 year ago

mihaitodor commented 1 year ago

Details here: https://en.wikipedia.org/wiki/Graham%27s_number

Rudxain commented 7 months ago

Easy, we just need BigInt support. According to ES, they are (theoretically) unbounded in size, so there's no need to worry about memory, as every browser must comply with the spec.

I've even wrote a function that we can use to test the code. Just call it like so:

import { Graham } from 'https://raw.githubusercontent.com/Rudxain/EsoMath.js/6ab44eae22d4b850e968a4a7a9f4c99d1a5ec9f2/src/lib/hyper.js'
const isEven = require('@samuelmarina/is-even')

isEven(Graham(64n)) //false