[Mono-list] Math precision.
Bob Smith
bob@thestuff.net
19 Jul 2001 14:16:58 -0600
Ok. I've used P/Invoke. The math class is now complete with a few
exceptions. It needs to be tested alot, I'll write some nunit tests
soon, I'm not sure which Dll to import. Problem is, the math functions
can be in different libs on different platforms. How are we to deal with
this?
I've implemented all the error checking that is listed in the spec, but
there are some casses that the c man pages list as errors. I need to map
them to c# errors and am not quite sure how it should be done since the
spec doesnt specify. If someone wants to volenteer to try some stuff on
their vs.net implementation and tell me what happens, I'd be
apreciative.
On 19 Jul 2001 11:50:10 -0700, Thomas F. Burdick wrote:
> Michael Meeks writes:
> >
> > Hi Bob,
> >
> > On 19 Jul 2001, Bob Smith wrote:
> > > > I've been working on the System.Math class, trying to implement
> > > > everything in C# without useing P/Invoke. I've been fairly successfull
> > > > at implementing the trig functions like sin/cos,
> >
> > Your implementation, although interesting is never going to be as
> > quick as the native versions of these functions built into modern
> > processors. A 'sin' is a handful of cycles and can be interleaved with
> > other floating point ops [ ok so not via PInvoke it can't :-], it would be
> > hundreds of times more efficient to just invoke the C routine which should
> > go to the co-proc.
>
> I'd say use PInvoke for simplicity (if it's in the libc, we may as
> well use it), and leave the question of efficiency to the JIT. If it
> open-codes functions that have hardware built-ins, we'll win quite a
> bit over going through PInvoke.
>
> _______________________________________________
> Mono-list maillist - Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>