Subject:
|
IC Programming.
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Tue, 29 Sep 1998 15:58:39 GMT
|
Original-From:
|
Keith - Lui <luikeith@!IHateSpam!egr.msu.edu>
|
Viewed:
|
1339 times
|
| |
| |
Hi all,
Does anyone know how to convert floating point variables to integers in IC?
I want to use the control the motor using an algorithm. However, that algorithm
always return a floating point number, and motor(m,p) can only use integer p.
Keith
|
|
Message has 1 Reply: | | Re: IC Programming.
|
| (...) Converting between types is called casting, and it goes like this: float f = 4.6; int i = (int) f; /* should assign 4 to i, I think */ f = (float) i; /* ought to assign 4.0 to f */ I'm not certain, but usually casting a float to an integer (...) (26 years ago, 30-Sep-98, to lugnet.robotics.handyboard)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|