what round() function???
And I am using floor because I want it to round to the floor! Not just to nearest integer, but to floor because,lets say, 0.75 has to be 0, not 1, and the floor of 0.75 is 0, not 1.
[NXC] floor function not working!!!!
Re: [NXC] floor function not working!!!!
Thanks, and have a nice day,
nxtboy III
programnxt.com
nxtboy III
programnxt.com
Re: [NXC] floor function not working!!!!
it's because you wrote something about "rounding", not about fractional cut. The term "rounding" means always up or down to the nearest integer, "floor" doesn't round but cuts off the frac part.
I think it was simply a misunderstanding of what you actually want or need.nxtboyiii wrote:EDIT: Is there a round function?(round to the nearest tenth, hundredth,etc)
If not, can someone show me how?
Re: [NXC] floor function not working!!!!
Yes. About that. I asked for a round function so when I use floor I can round the integer to the nearest tenth because of floating-point arithmetics.
Thanks, and have a nice day,
nxtboy III
programnxt.com
nxtboy III
programnxt.com
Re: [NXC] floor function not working!!!!
and do you want to round the float or truncate to 1 decimal fixed point and cut off the rest?
1.111 => 1.1 (is trivial)
but:
8.888 => 8.8 or 8.9?
1.111 => 1.1 (is trivial)
but:
8.888 => 8.8 or 8.9?
Re: [NXC] floor function not working!!!!
I want to round I guess.
Thanks, and have a nice day,
nxtboy III
programnxt.com
nxtboy III
programnxt.com
Re: [NXC] floor function not working!!!!
I got it to work!!
I just did what linusa said:
It didn't get messed up!!
Thanks doc-helmut and linusa!
I just did what linusa said:
Code: Select all
int xx;
float yy;
xx++;
yy=xx/10;
Thanks doc-helmut and linusa!
Thanks, and have a nice day,
nxtboy III
programnxt.com
nxtboy III
programnxt.com
Who is online
Users browsing this forum: Semrush [Bot] and 3 guests