Does Math.Sqrt cache its own results?

Posted by Jonathan Beerhalter on Stack Overflow See other posts from Stack Overflow or by Jonathan Beerhalter
Published on 2010-06-16T14:22:19Z Indexed on 2010/06/16 14:42 UTC
Read the original article Hit count: 142

Filed under:

Someone has suggested to me that the built in C# Math.Sqrt function in .NET 4.0 caches its results, so that if I call Math.Sqrt(50) over and over again, it's not actually doing a sqrt, but just pulling the answer from a cache. Can anyone verify or deny this claim? If it's true then I have a bunch of needless caching going on in my code.

© Stack Overflow or respective owner

Related posts about c#4.0