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 / 2250
2249  |  2251
Subject: 
Re: number conversions
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Mon, 2 Jun 1997 04:37:32 GMT
Original-From: 
Prabal Dutta <{prabal@dmsc.}IHateSpam{com}>
Reply-To: 
PRABAL@DMSC.stopspammersCOM
Viewed: 
1711 times
  
Keith,

The way to convert from floating point to int and vice versa in C is
called typed casting.  It is accomplished as follows:

integer_number = (int)floating_point_number;

for converting float to int.  To convert the other way, simply type:

floating_point_number = (float)integer_number;

Hope that helps!

- Prabal

Keith the wonder wookie wrote:

Is there any way to convert from an integer to a floating point and vice
versa in IC?  Please someone tell me there is a way!  Thanks.

Keith

Keith Soldavin
kas219@email.psu.edu
http://www.personal.psu.edu/kas219/

--
Prabal Dutta, President                    Tel:    (614) 299-2566
Digital Micro Systems, Corp.               FAX:    (614) 299-2939
PO Box 3579                                e-mail: prabal@dmsc.com
Columbus OH 43210-0579                     WWW:    http://www.dmsc.com



Message is in Reply To:
  number conversions
 
Is there any way to convert from an integer to a floating point and vice versa in IC? Please someone tell me there is a way! Thanks. Keith Keith Soldavin kas219@email.psu.edu (URL) (27 years ago, 1-Jun-97, 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