Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspxIn preparation for the next version of the product, we've collected suggestions for additions to the Math class and related classes. To give you an idea of the kinds of things people ask us for, here are a list of some of the requests we've received.en-USTelligent Evolution Platform Developer Build (Build: 5.6.50428.7875) BCL Team Blog Potential additions to the Math class Katy King | work from homehttp://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#9760305Tue, 16 Jun 2009 14:08:39 GMT91d46819-8472-40ad-a661-2c78acb4018c:9760305 BCL Team Blog Potential additions to the Math class Katy King | work from home<p>PingBack from <a rel="nofollow" target="_new" href="http://workfromhomecareer.info/story.php?id=478">http://workfromhomecareer.info/story.php?id=478</a></p>
<img src="http://blogs.msdn.com/aggbug.aspx?PostID=9760305" width="1" height="1"> BCL Team Blog Potential additions to the Math class Katy King | Cast Iron Cookwarehttp://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#9729102Fri, 12 Jun 2009 05:53:49 GMT91d46819-8472-40ad-a661-2c78acb4018c:9729102 BCL Team Blog Potential additions to the Math class Katy King | Cast Iron Cookware<p>PingBack from <a rel="nofollow" target="_new" href="http://castironbakeware.info/story.php?title=bcl-team-blog-potential-additions-to-the-math-class-katy-king">http://castironbakeware.info/story.php?title=bcl-team-blog-potential-additions-to-the-math-class-katy-king</a></p>
<img src="http://blogs.msdn.com/aggbug.aspx?PostID=9729102" width="1" height="1">Lab49 Blog » Blog Archive » Would you use .NET for advanced math tasks?http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#8410695Sun, 20 Apr 2008 05:01:52 GMT91d46819-8472-40ad-a661-2c78acb4018c:8410695Lab49 Blog » Blog Archive » Would you use .NET for advanced math tasks?<p>PingBack from <a rel="nofollow" target="_new" href="http://blog.lab49.com/archives/186">http://blog.lab49.com/archives/186</a></p>
<img src="http://blogs.msdn.com/aggbug.aspx?PostID=8410695" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#406852Sun, 10 Apr 2005 00:27:28 GMT91d46819-8472-40ad-a661-2c78acb4018c:406852RaphI work for a major UK bank, and we're currently switching away from .NET exactly because the product lacks these features. (eg decimal.pow with fractional powers)
<br>
<br>C# is a great language, but it does not have financially robust maths - we need to be able to place any decimal to any power. We need to specify rounding rules (eg when dealing with Swiss Francs or Argentinian Pesos). Replicating the J2SE5 BigDecimal is a start, but performance is key. Take a look at ArciMath, for example.
<br>
<br>Please, please, please solve this intelligently. Don't overload System.Math with more statics; instead, use generics and interfaces to push math operator logic (eg power()) onto the classes where IT BELONGS.
<br>
<br> Whilst you're at it, why not push operator overloads (eg +, -, *, etc) on to interfaces so we can create true value objects in code (such as Money) which are TESTABLE.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=406852" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#404538Sat, 02 Apr 2005 09:04:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:404538Mark A. RichmanHow about everything from "Numerical Recipies in C" seen here: <a target="_new" href="http://www.library.cornell.edu/nr/bookcpdf.html">http://www.library.cornell.edu/nr/bookcpdf.html</a><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=404538" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#402407Sat, 26 Mar 2005 19:39:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:402407Katy KingThanks for the great feedback, all! We will take this into account when planning new features.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=402407" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#401813Thu, 24 Mar 2005 22:15:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:401813Pazu1) Min and Max overloads that take more than two arguments - important, also take array[]; general feature
<br>Other functions that take a variable number of args - Sum() and Average(), and Product(), again on args[] and on normal arays
<br>Math.Pow() overload for Decimal - yes, this is important
<br>2) My tips - mybe not for Math - more support for converts to/from hexnumbers<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=401813" width="1" height="1">Tips http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#399840Mon, 21 Mar 2005 19:37:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:399840Ido SamuelsonTips <div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=399840" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#399259Sun, 20 Mar 2005 06:41:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:399259Andrew SujdakAs somebody who writes lots of numerical PDE stuff in the financial derivatives industry, I can tell you a few things:
<br>
<br>1. The guys selling numerical libraries DO NOT GET the concept of a well designed API. Most of them still come from the C world and there are very few .dlls out there that actually even have a native interface to .NET (ie no COM). Given that you didn't have support for this stuff in the beginning, anybody doing any sort of numerics work either wrote their own custom stuff or used somebody else's. The single best thing you could do is go out and beat up the third party vendors about their API designs. They're terrible. Maybe MS API certification or something? Realistically, you guys aren't ever (nor should you) going to be doing anything like implementing FFT or something. So if you really want to improve offerings for numerics, put the right kind of "positive pressure" on the 3rd parties.
<br>
<br>2. As a result of #1, you have to be really careful about coming up with new monolithic objects at this point. Most library guys actually develop their own vector and matrix classes. Personally, I'd prefer that any vector and matrix support offered by the framework come in the form of either operator overloading of value-type arrays in the framework or through additional static methods. My personal linear algebra library setup is called from my namespace System.MathX.LinearAlgebra, and contains only static methods.
<br>
<br>3. Complex numbers would be a very nice feature, but my understanding is that right now there's some kind of inlining problem with structs or something that makes them perform poorly... In any case, my industry doesn't really need complex numbers but most engineers use them all the time.
<br>
<br>I tried to stick to things that I felt actually added something that others had not said.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=399259" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#398727Fri, 18 Mar 2005 21:06:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:398727Jeffrey SaxMatt,
<br>
<br>Of course the result of x += y should be that x equals x+y.
<br>
<br>The difference is that x += y now always creates a new instance. You don't "add y to x", you "give x the result of x+y."
<br>
<br>Aside from the slight semantic difference, this is also a performance trap. It's widely documented that += is not to be used for string concatenation inside loops. Ok, for strings we have StringBuilder, but that solution isn't feasible for all such "large value types" (i.e. reference types with value semantics). Two primary examples are vectors and matrices.
<br>
<br>So I want in C# what C++/CLI does: allow me to optimize when I want to (i.e. override +=), and use the default behavior when I don't care to optimize.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=398727" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#398365Fri, 18 Mar 2005 05:08:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:398365Matt Selnekovic"x+=y is always interpreted as x = x+y."
<br>Uh, because that is the way it is supposed to work...
<br>x+=y is just a shorter way of saying x=x+y. It would be stupid to change the behavior. Having the += operator not do addition would be confusing.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=398365" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#398334Fri, 18 Mar 2005 03:43:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:398334Matthew W. JacksonOh.. Anyway, I'd vote for more trig and hyperbolic functions (for completeness...really...that's important to me in a library).
<br>
<br>The Min and Max overloads could be handled in a nice generics algorithms library that worked for all IComparable<T>, so you can leave those out, if you must.
<br>
<br>Sum and Average seems pretty silly...everybody should know how to do that (maybe put them in Micorosft.VisualBasic?)
<br>
<br>BigInteger and BigDecimal would be great, but they would need to be complete and well-performing. Please consider this. I mean, Java has it.
<br>
<br>BitShifting seems silly. Even VB has it now, and multiplcation works in most cases. Perhaps Bit Rotating, but that can also be implemented with Bit Shifting (but is the JIT smart enough to optimize a bit-rotate on x86?).
<br>
<br>Permutations and Combinations should be part of a nice statistical library. I guess Sum, Average, StandardDeviation and the like should go there (yeah...I guess Sum and Average would be okay in a Stats library).
<br>
<br>Math.Pow(decimal) should be in for completeness. Seems like an oversight, to me.
<br>
<br>Radian/Degree conversion...I could take it or leave it. You have Math.PI, which is all I ever need. You don't really want to open the floodgates for all unit conversions, do you?
<br>
<br>Vectors and Vector Math...no...I don't have faith that it would be done right...and if you do make them, then *DON'T* design them like System.Drawing.Point/PointF/Size/SizeF with tons of missing/screwed up operators and weird semmantics. I'm not too happy with DirectX's implementation of Vector, either, but it's a start. Besides, Vector really needs to be part of a larger math package...it's just the beginning. Maybe I'd accept it if you let me write it. :-)
<br>
<br>More MidpointRounding values would be great. I'm surprised rounding-up isn't supported, as that's what most school kids are taught. I'd propose that and rounding down (for completeness--again important), as well as some accepted pseudo-random rounding for high statistical accuracy.
<br>
<br>And a throwing math model would be nice, too. In C# I'd suggest a syntax such as "checked float { ... }" similar to "checked { ... }". That way a new keyword wouldn't be needed, and existing checked/unchecked code dealing with integers wouldn't break if they contained floating-point operations.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=398334" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#398327Fri, 18 Mar 2005 03:30:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:398327Matthew W. JacksonI really *would* like to see single-precision versions of the math functions, but I can see two potential problems with that:
<br>
<br>Aren't all the calculations done at the same precision anyway? Unless there's a special operator for single-precision floating point sine, putting overloads on there might give the illusion that you'll get better performance. I'd love to be wrong here, but isn't single-precision only helpful for saving space?
<br>
<br>Also, this would potentially break source-code compatability. Wouldn't the following code change?
<br>
<br>BinaryWriter writer = ...;
<br>float number = ...;
<br>writer.Write(Math.Sin(number));
<br>
<br>Currently, this would involve an implicit cast up to double, and a double would be written. With a single-precision overload, a float would be written.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=398327" width="1" height="1">Tips http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#398177Thu, 17 Mar 2005 22:16:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:398177David Boschmans' WeblogTips <div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=398177" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#398073Thu, 17 Mar 2005 21:09:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:398073Monroe ThomasWe really need to have interfaces that define permissable mathematical operations that types can support. This will allow us to build very cool generic algorithms, along with the very cool generic containers.
<br>
<br>See: <a target="_new" href="http://www.lambda-computing.com/publications/articles/generics/">http://www.lambda-computing.com/publications/articles/generics/</a>
<br><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=398073" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#397338Thu, 17 Mar 2005 11:05:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:397338SzokelizerMatrix math and rounding options would be a great thing...<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=397338" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#397132Thu, 17 Mar 2005 02:08:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:397132Jeffrey SaxShital, your criticism miss two crucial points. Java's numerical support is worse than .NET's. Also, the BCL is an excellent *general purpose* library. Like it or not, numerical computing is not mainstream.
<br>
<br>The issue I have is with the platform itself, which should be broad enough to support specialized applications. Some design decisions in .NET are extremely questionable from a numerical performance perspective. These should be addressed first. My list of top issues:
<br>
<br>- inlining of value type methods. It seems they didn't address the #1 performance scenario for value types.
<br>
<br>- the CLR throws arithmetic exceptions, which are way too expensive to be useful in numerical computations.
<br>
<br>- compliance with the IEEE-754/IEC 60559 standard is minimal. No rounding modes, no exception flags, no traps.
<br>
<br>- reference types with value semantics are assumed to be immutable. This is manageable for strings (thanks to StringBuilder) but doesn't work at all for vectors and matrices.
<br>
<br>- example: C# does not support overloading of compound assignment operators. x+=y is always interpreted as x = x+y. This leaves 2 choices: take a huge performance hit (up to 50x), or don't use operator overloading (even though math objects are primary candidates for overloading).
<br>
<br>None of these are BCL issues, so a comment on the BCL team blog may not be the best place to list them. Then again, it shows what must happen before some functionality can be included in the BCL.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=397132" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#397021Wed, 16 Mar 2005 23:20:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:397021Kit George [Msft]So much cool feedback here all, we really appreciate it, thanks. On Rounding by the way, check out the new overloads in recent bits, and you'll notice we have a new overload which allows you tou round the traditional way ;-)<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=397021" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#397020Wed, 16 Mar 2005 23:17:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:397020Shital ShahWhat else? Well, you have barely got anything more then basic math functionality and you are just giving few negligible additions. I'd love to see support for Matrices, Vectors, MathML (may be somewhere in Avalon) and everything else that would enable me to create advanced math functionality of calculator like HP48GX or TIs. It's funny that library designer always tend to insist that these are not the "core" or base level stuff and its not their responsibility to provide this functionality. This is usually because the code they already have is not readily expandable to accomodate these advance concepts or just may be general lack of skills on how to implement advanced math functionality. But if you had hired real mathematical programmers likes of the one at Mathematica they would have put this in the box from day one in probably 6 months. You may have little idea how many people struggle with these and end up creating their own versions for these basic structures and wasting thousands of hours in duplicating the functionality. It's funny that computers were first invented to do all these complex calculations (perhaps thats why they were called "computing machines") but now we almost always end up with just basic trignometry and algebra in libraries provided by so called modern plateforms and nothing more. It's a pitty because much of the code to do this, including solving equations or even proving undergrad math theorems, is available for free and could be easily integrated in to base library. I think if you beef up Math namespace in .Net, you will get tremendous attention from acadamia which usually tends to choose Java/C++.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=397020" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#396959Wed, 16 Mar 2005 22:02:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:396959Frank HilemanYou must know, the number one "gotcha" about Math on the newsgroups is Round? No one expects that function to do bankers rounding, and mathematically it is usually useless.
<br>
<br>I like these new items but I do not think Vector or Matrix should go into the System dll.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=396959" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#396816Wed, 16 Mar 2005 19:17:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:396816Jeffrey SaxHere's my opinion. + is good, - is not so good.
<br>
<br>- Single-precision trig (and other) overloads. Not very useful. I believe most calculations should be done (but not necessarily stored) in Double precision anyway.
<br>
<br>++ Inverse hyperbolic functions. Yes, please. This is clearly missing.
<br>
<br>-- More trig functions (csc, sec, cot). Not very useful: they have a very simple expression in terms of sin,cos, etc. Most expressions are easier to read with sin, cos than with csc, sec anyway.
<br>
<br>++ Min and Max overloads that take more than two arguments. Definite yes. System.Math is the only place to put these.
<br>
<br>+ Sum() and Average(), for example. Useful but not a priority.
<br>
<br>+ Complex number support. Sounds good, but it's hard to do this right.
<br>
<br>o Arbitrary-precision decimal numbers (BigDecimal): this is already available through the J# library (vjslib.dll)
<br>
<br>o+ Factorial, Permutations, Combinations: useful.
<br>
<br>++ Math.Pow() overload for Decimal: Yes, and what about Math.Pow for integer powers?
<br>
<br>- Convert between degrees and radians: define the conversion factor as a constant?
<br>
<br>+ Support for vectors and vector math (probably not in the Math class). Many .NET assumptions don't hold for vectors, with severe performance penalties if you ignore this.
<br>
<br>+ Add new values to the MidpointRounding enum - which ones? Simply provide the 4 'standard' rouding modes wherever available: up, down, to zero, to nearest/even.
<br>
<br>++ Provide a different math model for operations, that throws instead of obeying IEEE (returning NaN/Infinity). This is IEEE *default* behavior. Could be extremely useful, along with "sticky bits", but exceptions would have to be made a lot cheaper for this to live up to its potential.
<br>
<br>Other items I would like to see:
<br>
<br>+++++ Have the JIT inline value type methods.
<br>
<br>+++ Support for floating-point exception flags ("sticky bits")
<br>
<br>++ More meaningful constants for Single and Double: NegativeZero and constants related to range and precision, including the 'actual' Epsilon. (See float.h for inspiration.)
<br>
<br>+ Three more functions: Expm1 (Exp(x)-1 for higher precision when x is around 0), Log1p (Log(1+x) for x around 0) and hypot(x, y).
<br>
<br>+ Support for setting rounding modes.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=396816" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#396791Wed, 16 Mar 2005 18:47:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:396791CraigBigInt would be my #1 request. <div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=396791" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#396729Wed, 16 Mar 2005 17:09:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:396729Mark MullinHmmm -
<br>
<br> singleprec trig - xlnt
<br>
<br> hyperbolics - check
<br>
<br> more trig - check, keeps me out of the receipes book :-)
<br>
<br> list base min & max - yeah, thats nice
<br>
<br> sum() is nice - average() mebbe, but what if I need other measures like median, stddev, etc - a more generalized stats class might be nice
<br>
<br> complex numbers - oh great, go out and steal math's version of hello world. oh, ok - it's useful
<br>
<br> bitshifting - why not just get rid of VB ? :-) I would add to this a mechanism to make it easier to convert floats to longs and a mechanism to convert doubles to longlongs - some of us have math routines where we need to set constants _very_ exactly - your testers most likely have this need too
<br>
<br> bignums - love em
<br>
<br> factorials - as long as it's optimized
<br>
<br> perms and combs - nahh - factorials is already pushing it - do this only if you want to do an algebra lib, and then there's a lot of other stuff you need to consider
<br>
<br> decimal pow - hmm, why not make decimal completely symettric ?
<br>
<br> convert between degrees and radians - you don't need a function for this, just a couple of constant properties giving multipliers - if you're looking at making degrees wrap, i.e. 0 = 360, thats a different AND NASTY issue - graphics guys run into this a lot when we do texture wraps, solution requires context - hence I'd just stick with providing convienience constant multipliers
<br>
<br> vectors and vector math - hmmm, I have those and they're big classs, and as soon as you do vectors, matrices come too - yes in general, but it's a big challenge dot , cross, triple cross, normalization, polar to cartesian and v.v., basis vectors, basis function, etc - very big list, and then come even stranger things
<br>
<br> midpoint rounding - expose control for full IEEE 764 mechanisms
<br>
<br> NO NO NO NO don't change math model - HaNs are perfect, if we need to throw
<br> if(value != value)
<br> throw("math all bollixed") works fine
<br>
<br>Other issues
<br> SIMD!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<br> Other means to optimize calc pipeline
<br>
<br>In general, most of us who need the high level stuff have done it - what we could really use is having the low level run optimally - giving us a way to set up parallelized simd would be a huge gain<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=396729" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#396708Wed, 16 Mar 2005 16:32:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:396708Samuel JackI want to add my vote to Min and Max taking more than two arguments.<div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=396708" width="1" height="1">re: Potential additions to the Math class [Katy King]http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396451.aspx#396707Wed, 16 Mar 2005 16:30:00 GMT91d46819-8472-40ad-a661-2c78acb4018c:396707PeterTThe most useful for me would be:
<br>1. Conversion between decimal and degrees. This would be convenient. In fact my preferred embodiment would be to encapsulate this in an "Angle" class with properties "Degrees" and "Radians". I've been on a number of projects that have had bugs related to incorrect interpretation of a "double".
<br>2. Variable argument versions of: Sum(), Average(), Min(), Max()
<br>3. Single precision trig functions. Would be convenient.
<br>4. Complex Number support. Don't need it now, but would sure prefer not to write or source my own if/when I do.
<br>5. Vector and vector math. This might be useful if:
<br>a. There is also a matrix class, or I can implement my own by wrapping vector class in a straightforward manner.
<br>b. Performance is close to an unmanaged implementation. My experience is that my hand-tuned unsafe C# implementation of a vector-matrix multiplication was still a factor of 2 slower than using P/Invoke with a native C implementation.
<br><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=396707" width="1" height="1">