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 / 2257
  RE: Incorrect result
 
<snipped code> (...) Robert, this is a classic problem with ranges of singed numbers in C rx = (long)(a->magnitude * TA_costable[a->direction]) >> 7; I don't have an RCX in frot of me, but I think you need to cast a->magnitude to long before the (...) (22 years ago, 30-Jan-02, to lugnet.robotics.rcx.legos)
 
  Re: Incorrect result
 
(...) Yes, this is what happens when one is used to just making everything long and not considering overflows. Even worse was that I was doing the math on the computer's calculator, but not looking at the intermediate result, just typing in the (...) (22 years ago, 30-Jan-02, to lugnet.robotics.rcx.legos)

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