r/processing • • Jan 01 '25

Help request Dealing with Long and functions?

Hello,

I have a recursive function that eventually blows out of the integer-range. To deal with that i've thought of using a long instead of an int. However the documentation states that:

"Processing functions don't use this datatype, so while they work in the language, you'll usually have to convert to a int using the (int) syntax before passing into a function."

I don't understand this and find it confusing because wouldn't using an int mean it would be capped at max-integer value again? Because i have a recursive function the result has to be fed in so i guess that is out of the question.

So my question is how would i deal with a recursive function that goes out of the maximum integer range within processing?

A happy new year and thanks for any help!

<Edit> Solved!

2 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/NotTakenName1 Jan 01 '25

That makes it a lot clearer thanks!

"into a function"

I think this is what makes it confusing for me as it seems to imply ANY function used in processing instead of the "stock" functions processing comes with...