[openbeos] Re: trigonometric functions

  • From: "Andrew Bachmann" <andrewbachmann@xxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Wed, 18 May 2005 15:49:20 -0700 PDT

"Axel DÃrfler" <axeld@xxxxxxxxxxxxxxxx> wrote:
> "Andrew Bachmann" <andrewbachmann@xxxxxxxxxxxxx> wrote:
> > I have added some math tests to: src/tests/kernel/libroot/posix/math
> > They currently just print a table of the values from our cos/sin
> > functions and the values from libbe.  The results are the same as
> > Stephan reported. (these functions don't work properly)
> 
> Great!
> BTW why do you need to define "national" for the libroot.so build but 
> not for you test application?

I had to define it for both.
 
> > sin and cos seem to be broken because their subfunctions are
> > broken.  This includes at least copysign, and probably drem.
> > I may add some tests for these subfunctions specifically since
> > they are also supported by libbe.
> 
> I guess you mean Be's libroot.so here.

Ah yes, of course. ;-)
 
> > Two side notes:
> > 1. the tests should probably be moved from "kernel" to "system",
> > like the src subdirectory was a little while back.
> 
> Definitely, I just didn't find the time to do it yet.

I thought "this is easy now that we have svn" then I realized that all
the Jamfiles have to change too.
 
> > 2. the math test uses get_image_symbol to retrieve the libbe
> > function pointers for cos/sin, which is a technique that could
> > be useful for other tests as well.
> 
> Not too useful most of the time, as these tests are usually thought to 
> run under both platforms. Ie. also, and especially, natively under 
> Haiku, for example.
> It's better to test against known behaviour (like sin^2 + cos^2 == 1 in 
> your test).
> 
> Bye,
>    Axel.

Although the way the test is currently written it should also run
under haiku, a large portion of it will be moot since libroot.so in
haiku will be the same code as the test. :-)

Andrew


Other related posts: