To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 5067
5066  |  5068
Subject: 
Re: Type conversion IC.
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Thu, 7 Jan 1999 03:45:01 GMT
Original-From: 
Christopher Prosser <christopherprosser@IHATESPAMyahoo.com>
Reply-To: 
cprosser@acm.[NoSpam]org
Viewed: 
838 times
  
I don't have IC handy, but you should just be able to do
a hard cast.
float aFloat = 1.3;
int   anInteger = 0;
anInteger = (int) aFloat; /*cast the float to an int */

/*you can also do it in a function call*/
FuntionTakesAnInt( (int) aFloat );

Hope this helps!
-Chris Prosser




---FEDERICO SANTELLO <fedsante@tin.it> wrote:

Hi to all
And HAPPY NEW YEAR.

I have a question.
How can i convert a floating variable into a integer variable?
I must send via serial line the result of the functions SECONDS().

Thank

Federico

E-mail:fedsante@tin.it




1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR