RSS Forums RSS
Please support our C advertiser: Programming Forums

unsigned long division operation

Join Date: May 2006
Posts: 2,814
Reputation: WaltP is a splendid one to behold WaltP is a splendid one to behold WaltP is a splendid one to behold WaltP is a splendid one to behold WaltP is a splendid one to behold WaltP is a splendid one to behold WaltP is a splendid one to behold 
Rep Power: 16
Solved Threads: 240
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Maven

Re: unsigned long division operation

  #2  
Nov 2nd, 2007
You can't possibly get 155.419 from an unsigned long, there is no decimal point from integers. You need float or double.

And dividing two integers always gives an integer, even if you load it into a floating point number. For example:
  1. double dval;
  2. dval = 25/2;
12.000 is loaded into dval, not 12.5.
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough.
-- Pearl Williams
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:22 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC