[Mono-list] Math precision.

Tyson Dowd trd@cs.mu.oz.au
Fri, 20 Jul 2001 01:16:37 +0200

On 19-Jul-2001, Michael Meeks <michael@ximian.com> wrote:
> 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 thought the most basic profile of the CLR doesn't even include
floating point support (according to the ECMA specs last time I looked).

You aren't necessarily going to get native support for sin/cos on
platforms that don't even have an FPU.
(not that I'm saying the current decision is a bad one, at the moment it
seems like the right way to go, just that it might need to be touched
upon again later).

Which profile is Mono targetting?  This is not in the FAQ, but there are
a quite a few issues which it raises.