RobotMonkeyHead Posted August 4, 2015 Posted August 4, 2015 Ok, I realize this is a pretty basic question.For example if I run the following code, it produces a debug flood, saying truncated float to int. alpha = 256 - (256 / (time * .25)), 256Is there an easy way to just round that noise inside the parenthesis to an int? ~ℛ.ℳ.ℋ.
1 Алексей Posted August 4, 2015 Posted August 4, 2015 floor() or ceil(). Unfortunately, there is no "round" or I'd easily suggest that. floor() will drop all digits past the decimal point and ceil() will round up and return the least possible Int. Think of floor() as rounding down and ceil() as rounding up. I think that's the easiest way to explain it. -[Все слова это только слова.]-
0 RobotMonkeyHead Posted August 4, 2015 Author Posted August 4, 2015 Ah, thanks again Anekcen. ~ℛ.ℳ.ℋ.
0 Алексей Posted August 4, 2015 Posted August 4, 2015 No problem. Just call me Alexei or Aleksey. :P -[Все слова это только слова.]-
Question
RobotMonkeyHead
Ok, I realize this is a pretty basic question.
For example if I run the following code, it produces a debug flood, saying truncated float to int.
alpha = 256 - (256 / (time * .25)), 256
Is there an easy way to just round that noise inside the parenthesis to an int?
~ℛ.ℳ.ℋ.
4 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now