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 / 3052
3051  |  3053
Subject: 
Re: Float and int
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 30 Dec 2002 19:16:47 GMT
Viewed: 
2863 times
  
Jonathan Wilson wrote:
But doing float with the brick is s-l-o-w, better avoid it if you can.

Mabie Fixed Point is an answer.

For most brick projects I can think of, it is. If you want to travel
your robot around, you will have to deal with sin, cos, tan and square root.

First thing you can do is working with tables to avoid "on the fly" sin
calculation. Second, you could multiply your table values with a factor
and get int (or long) values instead. For example, a sinus value for 45°
could be stored as 707 when you multiplied it by 1000.

Regards,

Michael



Message is in Reply To:
  Re: Float and int
 
(...) Mabie Fixed Point is an answer. I dont know how it works but I have a book that suggests that a decent Fixed Point library can be faster than Floating Point if there isnt an FPU available. (22 years ago, 30-Dec-02, to lugnet.robotics.rcx.legos)

6 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