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 / 5572
5571  |  5573
Subject: 
Re: Type conversion.
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Fri, 19 Feb 1999 22:40:53 GMT
Original-From: 
Nick Taylor <ntaylor@iname.com>
Viewed: 
789 times
  
FEDERICO SANTELLO wrote:
<snip>
My answere are , how can i convert a integer number to a floating point
number?
          int temp;
          float dtemp;

         dtemp=temp*3.5;

But when i try to download i've an error type not compatible.

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 - - -



Message is in Reply To:
  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)

5 Messages 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