Subject:
|
mixing variable types in IC
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Sun, 14 Nov 1999 13:58:35 GMT
|
Original-From:
|
John Bachman <bachman@anatek./Spamless/mv.com>
|
Viewed:
|
1016 times
|
| |
| |
Now that I got past my nested function problem I have discovered that IC does not like mixing variable types. For instance, this results in an error:
int x, y;
float c;
float
divide ( int x, int y)
{
c = (x/y);
return c;
}
IC will not let me calculate a float from two integers although it is a perfectly reasonable mathematical operation. It complains about float/int incompatiblity. The only solution this hapless programmer can find is to just give in and make everything float. But that is a big waste of resources when x and y are truly integers.
Must be a more elegant way to do this. Damned if I know what it is.
TIA
John
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|