When to use `.Math.decrementExact(int x)` instead of `x--`
I read through the Oracle: class Math and was curious, why it even exists, when ive only seen
-- yet.7 Replies
⌛ This post has been reserved for your question.
Hey @Darknesslion5|Christian! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
i think the only big difference is that you get an artihmetic exception
when the number would overflow
so its safe when it comes to that
what i mean is with
if x is -2147483647
and you do x--
i know like int(2^32)-1
its 2147483647
yea
and it overflows
thanks
makes sense
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.Post Closed
This post has been closed by <@245536392308981760>.