Yes, Sun can (Oracle now, I guess):
fdlibm, the "freely distributable math library", has sqrt and pow, along with many other math functions.
They're fairly high-tech implementations, though, and of course nothing is ever the "most efficient" implementation of something like this. Are you after source code to get it done, or are you really not so much looking for pow
and sqrt
, but actually looking for an education in floating-point algorithms programming?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…