View Single Post
  #4   Spotlight this post!  
Unread 29-01-2005, 12:10
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,797
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Converting floating point to integers

Quote:
Originally Posted by logicalhippo
float f = 245.56;
int i;
i = (int)f;
printf("%d\n", i);

the output will be 0.
That code works fine for me. There's something else at work here.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle