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 / 5570
  Type conversion.
 
Hi to all. I'm not very practice with IC. My answere are , how can i convert a integer number to a floating point number? I want to make a moltiplication between an intger number and a floating. I make this: int temp; float dtemp; dtemp=temp*3.5; (...) (26 years ago, 19-Feb-99, to lugnet.robotics.handyboard)
 
  Re: Type conversion.
 
FEDERICO SANTELLO wrote: <snip> (...) Federico - - Try doing it this way: (it's called a "cast") int temp; float dtemp; temp = 5; dtemp = (float)temp*3.5; printf("dtemp=%f\n",dtemp); Enjoy, - - - Nick - - - (26 years ago, 19-Feb-99, to lugnet.robotics.handyboard)
 
  Re: Type conversion.
 
(...) Hi, what you want to do is called type casting,ie. you must explicitly specify the type. I've included some sample code that uses it. Because the beeper function expects a float but the knob function returns an integer, you have to modify the (...) (26 years ago, 19-Feb-99, to lugnet.robotics.handyboard)
 
  Re: Type conversion.
 
Dear Federico, Typecast the integer into float. ie write the statement as dtemp=(float)temp*3.5 Refer to any C book for information on typecasting. Yours sincerely, Nitin (...) (26 years ago, 21-Feb-99, to lugnet.robotics.handyboard)
 
  Are E9's compatible with HB?
 
I have a line on a bunch of MC68HC11E9's and I was wondering if these were compatible with the HB. Any help would be great! STEVE ___...___ Steve Wall Sir Sandford Fleming college Swall@flemingc.on.ca (26 years ago, 15-Mar-99, to lugnet.robotics.handyboard)

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