Go to Post The best we can all do for our kids as parents, mentors and world citizens, is to model [Gracious Professionalism] always: not to win an award, but because it is the right thing to do. - chapman1 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Spotlight this post!  
Unread 09-01-2008, 01:52
JohnC's Avatar
JohnC JohnC is offline
my other name is nigel
FRC #0360 (360 Revolution)
Team Role: Programmer
 
Join Date: Mar 2005
Rookie Year: 2005
Location: user_routines.c
Posts: 100
JohnC is a jewel in the roughJohnC is a jewel in the roughJohnC is a jewel in the roughJohnC is a jewel in the rough
Send a message via AIM to JohnC
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
__________________
What place are we at? ... TODAI!
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 18:41.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi