Thumbs up x1
by -BY » September 4th, 2013, 7:07 am
- This post by -BY was thumbed up by:
- Killswitch (September 4th, 2013, 7:51 pm)
Bump because I'd need help as well.
I'm taking programming lessons at my working place for a bit now and am supposed to find a solution for a problem with some restrictions till tomorrow. I hope to get some help. Even if it's probably rather C related than C++. Anyways.
I'm supposed to get the program to round numbers + I need to explain the solution to everyone. No specific numbers. So for example 3.5546 would get changed to 3.555 or 3.5544 to 3.554. I shall only use +, -, *,/ and the int/double function.
The solution is somehow related to:
int x = (Number*100) +0.5
double y = x/100.0
I'm probably failing to understand something really simple. But some of you might know the feel if you got to an dead end.
I'd try to use 'if' functions and other stuff, but that's forbidden.
It'd be awesome if someone could explain the solution somehow.
Edit: Japes being awesome solved the problem.
Big thank you to FrozenFire who created this masterpiece. : )