Go to Post My wife got mad at me when I told her I wanted to name our daughter Lotus. "What you mean the software?" she squawked. "No I mean the flower." I said. geeks, I swear.... - Koko Ed [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
  #1   Spotlight this post!  
Unread 28-01-2005, 20:31
logicalhippo logicalhippo is offline
Registered User
AKA: Russell McClellan
#0213 (Dirty Birds)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Keene, NH
Posts: 11
logicalhippo is an unknown quantity at this point
Send a message via AIM to logicalhippo
Unhappy Converting floating point to integers

I'm having a little problem with converting floating point values to integers. if I do something like this:

float f = 245.56;
int i;
i = (int)f;
printf("%d\n", i);

the output will be 0. Can anyone explain this problem? Do I need an explicit conversion? If so, where could I find documentation on it?
 


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
Top 10 Uses for the 10 Point Balls EddieMcD Chit-Chat 10 30-03-2004 18:29
FIRST @ The Point...Who's Going? archiver 2000 0 23-06-2002 23:24
Possible Configuration to keep things cheap archiver 1999 8 23-06-2002 23:03
Is it weird to see an atwood motor floating in mid air? mnkysp6353 Chit-Chat 6 19-02-2002 21:38


All times are GMT -5. The time now is 19:33.

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