2

What is the maximum value of an int in ChucK? Is there a symbolic constant for it?

2 Answers 2

6

New in the latest version!

<<<Math.INT_MAX>>>;

For reference though, it uses the "long" keyword in C++ to represent integers. So on 32-bit computers the max should be 0x7FFFFFFF, or 2147483647. On 64-bit computers it will be 0x7FFFFFFFFFFFFFFFFF, or 9223372036854775807.

Answer from Kassen and Stephen Sinclair on the chuck-users mailing list.

1

The ChucK API reference uses the C int type, so the maximum value would depend on your local machine (2^31-1, around two billion on standard 32-bit x86). I don't see any references to retrieving limits, but if ChucK is extensible using C you could add a function that returns MAXINT.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.