[Mono-dev] System.Math implementation

Rusmin Susanto rusminsusanto at yahoo.com
Mon Mar 20 17:18:51 EST 2006

Hi all. I have some questions to ask:
  1. In the folder /mono/mcs/class/corlib/System there is a file Math.cs. Some functions in this class (eg. Sin, Cos, etc) are implemented in C. For example, the Sin function is declared as 
   [MethodImplAttribute (MethodImplOptions.InternalCall)]
 public extern static double Sin (double x);
  I tried to find the C implementation for the Sin function above. It looks like that it is implemented in /mono/mono/metadata/sysmath.c (see line 70). When I modify this function (eg. return (2.0 * sin (x)), why do I still get the same output? Why don't I get 2 * sin (x)?
If sysmath.c does not contain the implementaton, where is the Math.Sin() implemented?
  I really want to know how this works.
2. I know that the C# is written in C#. However, I believe that the very basic functionality of that C# compiler is implemented in C (am I right?). If yes, where can I find that C implementation?
Many thanks for your attention

 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060320/5902ab69/attachment.html 

More information about the Mono-devel-list mailing list