|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#11
|
||||
|
||||
|
Re: How does division work?
If you add 0.5, it will "round" to the nearest integer:
int x = (int)(40/9 + 0.5); // 40/9 = 4.444 repeating and rounds down to 4 int y = (int)(40/6 + 0.5); // 40/6 = 6.666 repeating, rounds up to 7 |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How does it work? | Ryan O | Control System | 5 | 12-03-2006 19:15 |
| How does Nationals work? | coldfusion1279 | Championship Event | 29 | 30-03-2005 16:47 |
| How Does a Winch Work? | Aaron Lussier | Technical Discussion | 23 | 20-01-2004 21:14 |
| how does crab drive work? | Soukup | Technical Discussion | 13 | 25-04-2003 11:31 |
| How does Nationals work?? | LunchBox | Championship Event | 16 | 18-03-2003 15:55 |