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 / 770
769  |  771
Subject: 
Re: How do you convert a int to a long or float?
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Thu, 26 Sep 1996 04:25:31 GMT
Original-From: 
Fred G. Martin <fredm@media.SPAMCAKEmit.edu>
Viewed: 
1529 times
  
I need to convert a int to either a long or float.  I've always had a
compiler that auto converts.  I don't remember how to do it.  I'd welcome
any help.

Coercion is done by putting the type you want to convert it to in
parens before the thing being converted; e.g.:

  float f = (float) 33;
  int i = (int) 10.;

best,
Fred



Message is in Reply To:
  How do you convert a int to a long or float?
 
I need to convert a int to either a long or float. I've always had a compiler that auto converts. I don't remember how to do it. I'd welcome any help. Jim (28 years ago, 26-Sep-96, to lugnet.robotics.handyboard)

2 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