原文:http://blog.51cto.com/wushank/1585927
以下仅仅记录了我需要的部分。
一、对CPU进行简单测试:
1、通过bc命令计算特别函数
例:计算圆周率
echo "scale=5000; 4*a(1)" | bc -l -q
MATH LIBRARY
If bc is invoked with the -l option, a math library is preloaded and the default scale is set to 20.
The math functions will calculate their results to the scale set at the time of their call. The math
library defines the following functions:
s (x) The sine of x, x is in radians. 正玄函数
c (x) The cosine of x, x is in radians. 余玄函数
a (x) The arctangent of x, arctangent returns radians. 反正切函数
l (x) The natural logarithm of x. log函数(以2为底)
e (x) The exponential function of raising e to the value x. e的指数函数
j (n,x) The bessel function of integer order n of x. 贝塞尔函数