Skip to content

Implement grains after TS gains int Type #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
masters3d opened this issue Mar 8, 2017 · 3 comments · Fixed by #440
Closed

Implement grains after TS gains int Type #21

masters3d opened this issue Mar 8, 2017 · 3 comments · Fixed by #440
Assignees
Labels
enhancement 🦄 Changing current behaviour, enhancing what's already there

Comments

@masters3d
Copy link
Contributor

masters3d commented Mar 8, 2017

Grains needs a BigInt Library http://www.2ality.com/2015/04/numbers-math-es6.html

microsoft/TypeScript#4639 (comment)

/**
 * In JavaScript, integers beyond +/- 9007199254740991 cannot be accurately
 * represented. To see this in action, console.log() out the expected number
 * of grains on square #64:
 *
 * console.log(9223372036854775808);
 * // =>       9223372036854776000
 * //                         ^^^^
 *
 * This is because, in JavaScript, integers are represented as 64-bit floating
 * point numbers. If you want to learn more, see:
 *
 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
 * http://stackoverflow.com/questions/307179/what-is-javascripts-highest-integer-value-that-a-number-can-go-to-without-losin
 *
 * So, an accurate solution to this problem requires the use of a
 * "big integer" type. There are multiple ways to use big integer types.
 * We have provided you with BigInteger.js. You can read more about it here:
 *
 * https://github.com/peterolson/BigInteger.js
 * ^--- The "Methods" section of the README will be especially helpful.
 *
 * https://github.com/peterolson/BigInteger.js/blob/master/spec/spec.js
 * ^--- Tests are a good way to understand, in addition to the README.
 *
 * To get you started, this folder has a file of the big-integer module.
 * See its tests in this folder for a quick primer on how to use it! ( :
 */
@masters3d
Copy link
Contributor Author

masters3d commented Dec 14, 2017

BigInt is at stage 3, log time coming.
https://github.com/tc39/proposal-bigint

@masters3d
Copy link
Contributor Author

@SleeplessByte SleeplessByte added the enhancement 🦄 Changing current behaviour, enhancing what's already there label Apr 12, 2019
@joshiraez
Copy link
Contributor

I'll take a look at this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🦄 Changing current behaviour, enhancing what's already there
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants