-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
Big Numbers for Constants #2
Comments
BigNum as a language feature is going to need RAII semantics (destructors and copy/move semantics). As just about all standard implementations will allocate auxiliary memory that needs to be cleaned up. Though if you just want something that works for compile-time constant folding then something like gmp (licenced under LGPL v3) would work. It does both integer and floating point math. |
Sorry for the confusion but I do not want this to be a run time feature but rather a compile time feature for the constant system. I want numbers to just work as number. gmp might be a good option so I might have to consider it. |
http://www.libtom.net/LibTomMath/ is also a good alternative. Dual licensed as public domain / WTFPL. |
This has been implemented with the new custom |
In this language, I want constants to work very similar to how they work in Go. This requires the need for a big numbers library as it needs arbitrary precision for numbers to behaviour as numbers.
Should be valid and result in
NUM_B == 1<<10
.Blog article on how Go constants work: https://blog.golang.org/constants
The text was updated successfully, but these errors were encountered: