To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / *2554 (-5)
  Re: Converting a float to an integer
 
It looks like xdist and ydist are integers. You divide an integer by an integer, the answer is an integer. For example, if xdist=5 and ydist=10, you have 5/10, the answer is 0 (with a remainder of 5). So, if you do the multiply first, you will be (...) (22 years ago, 13-May-02, to lugnet.robotics.rcx.legos)
 
  RE: Converting a float to an integer
 
I have built a plotter and want to draw a diagonal line of varying angles. It requires one motor to run slower then the other at a ratio based on the distance it has to travel compared to the other one. So I do something like this xspeed = (int) (...) (22 years ago, 9-May-02, to lugnet.robotics.rcx.legos)
 
  Re: egcs compiler - float problems?
 
(...) I have not tried to compile this, but one thing that looks suspicious is that you are using doubles. Doubles are not supported. The compiler I have (some old version of GCC) treats doubles and floats as the same type. The compiler you're using (...) (22 years ago, 10-May-02, to lugnet.robotics.rcx.legos)
 
  egcs compiler - float problems?
 
Can someone using the egcs compiler suite test the following code? It seems it doesn't compile under egcs. int main(int argc, char *argv[]) { double foo = 1.0; return foo > 0.1 ? 0 : 1; } Compiles fine under gcc 3.0.3. Regards, Michael (22 years ago, 10-May-02, to lugnet.robotics.rcx.legos)
 
  More problems with floats
 
When I try to compile a program containing the following function: bool tr_guard_foo_loc2_t0() { return getVarVal(&var_foo_cl) >= 0.1; } I get this error: /tmp/ccyEbqnS.s: Assembler messages: /tmp/ccyEbqnS.s:237: Error: cannot create floating-point (...) (22 years ago, 10-May-02, to lugnet.robotics.rcx.legos)


Next Page:  5 more | 10 more | 20 more

Redisplay Messages:  All | Compact

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR