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 / 1856
1855  |  1857
Subject: 
Re: C standard functions with legOS?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 25 Apr 2001 22:43:59 GMT
Viewed: 
1339 times
  
In lugnet.robotics.rcx.legos, Michael Wisse writes:
Is it possible to use functions from C standard libraries with legOS,
e.g. sin() from math.h or abs() from stdlib.h?

They are a part of gcc, but e.g. math.h seems to produce compiler
errors.

The cross-compiler is set up to not use standard libraries. This is to give
more control over the code produced. Also, many standard functions just
wouldn't work on the H8. There is a float library (lib/float), which allows use
of floating point variables, but only has minimal functions (add, multiply
compare etc). If you want floating point math functions, you'll have to write
them yourself (though you can probably use some code from libm if you have the
source). Note that floating point on the H8 would probably use heaps of memory
& processor time, so not highly recommended.

One way to get sin, cos etc would be to use lookup tables, though this also
uses memory.

Good luck

ROSCO



Message has 1 Reply:
  Re: C standard functions with legOS?
 
(...) An alternative is using fixed point math. There was some posts time ago, with C source for trigonometric functions. If you are interested, I should have links to them, somewhere (or do a `search' :-). bye Bernardo New e-mail: (...) (23 years ago, 26-Apr-01, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  C standard functions with legOS?
 
Is it possible to use functions from C standard libraries with legOS, e.g. sin() from math.h or abs() from stdlib.h? They are a part of gcc, but e.g. math.h seems to produce compiler errors. Best regards. Michael Wisse (23 years ago, 25-Apr-01, to lugnet.robotics.rcx.legos)

5 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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