RobotMonkeyHead Posted August 4, 2015 Share 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? Link to comment Share on other sites More sharing options...
1 Алексей Posted August 4, 2015 Share 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. Link to comment Share on other sites More sharing options...
0 RobotMonkeyHead Posted August 4, 2015 Author Share Posted August 4, 2015 Ah, thanks again Anekcen. Link to comment Share on other sites More sharing options...
0 Алексей Posted August 4, 2015 Share Posted August 4, 2015 No problem. Just call me Alexei or Aleksey. :P Link to comment Share on other sites More sharing options...
0 RobotMonkeyHead Posted August 6, 2015 Author Share Posted August 6, 2015 Will do. Link to comment Share on other sites More sharing options...
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?
Link to comment
Share on other sites
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