|
On Sun, 12 Nov 2000, mike mcfarlane wrote:
> Hi
> What math functions are available under legOS? I can get the usual +-/ and *
> to work, but not powers or square roots. Are these math functions available
> and what others e.g. sine, cosine etc?
> I thought it would be standard C stuff like pow and sqrt, but they don't
> appear to work and I can't find a header file with any math functions in.
> Not that I like the stuff or anything ;-)just need to use it.
Most math functions aren't available. They would require so much computing
power, and so few people would use them, that they probably aren't worth
the code space in the kernel. You could probably find some sample
implementations of pow and sqrt floating around and just put them in your
program. Same for trig functions, I guess. I have a library of fixed-point
math routines that includes all trig and inverse-trig functions along with
it. It works great in fixed-point, and could probably be converted to
floating if that's what you're looking for. If you're interested, just let
me know, and I'll be happy to send it along.
Hmm, while we're on the subject, is anybody ELSE interested in a library
of fixed-point math routines? They seem to take up significantly less code
space than the 2k needed for the floating-point routines, and they're
probably faster to boot. I use them all over in my program, and I'd be
more than happy to share.
--
"Say not, 'I have found the truth,' but rather, 'I have found a truth.'
"Say not, 'I have found the path of the soul.' Say rather, 'I have met the
soul walking upon my path.'" -- Khalil Gibran
Mike Ash - <http://www.mikeash.com/>, <mailto:mail@mikeash.com>
|
|
Message is in Reply To:
| | Math
|
| Hi What math functions are available under legOS? I can get the usual +-/ and * to work, but not powers or square roots. Are these math functions available and what others e.g. sine, cosine etc? I thought it would be standard C stuff like pow and (...) (24 years ago, 12-Nov-00, to lugnet.robotics.rcx.legos)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|