c# 4.0 - Does Math.Sqrt cache its own results? -
Someone has suggested to me that the built-in C # Math.Sqrt
function in the .NET 4.0 cache The result is, so if I call it more often than Math.Sqrt (50)
, it is not actually doing an SQLRT, but it's just pulling the answer with a cache. Can anyone verify or reject this claim? If this is true then I have a bunch of unnecessary caching in my code.
I do not have .NET 4 installed but you can easily see the method mentioned in Reflection.
This is the only way that you will be sure to see what's going on.
Comments
Post a Comment