碧海潮生's profile碧海潮生的小屋PhotosBlogLists Tools Help

Blog


    October 07

    C语言专题——标准库<math.h>

    1 三角函数

    double sin (double);
    double cos (double);
    double tan (double);
     

    2 反三角函数

    double asin (double);   结果介于[-PI/2, PI/2]
    double acos (double);   结果介于[0, PI]
    double atan (double);   反正切(主值), 结果介于[-PI/2, PI/2]
    double atan2 (double, double);  反正切(整圆值), 结果介于[-PI/2, PI/2]
     

    3 双曲三角函数

    double sinh (double);
    double cosh (double);
    double tanh (double);
     

    4 指数与对数

    double exp (double);
    double pow (double, double);
    double sqrt (double);
    double log (double);   以e为底的对数
    double log10 (double);
     

    5 取整

    double ceil (double);   取上整
    double floor (double);   取下整
     

    6 绝对值

    double fabs (double);
     

    7 标准化浮点数

    double frexp (double f, int *p); 标准化浮点数, f = x * 2^p, 已知f求x, p ( x介于[0.5, 1] )
    double ldexp (double x, int p); 与frexp相反, 已知x, p求f
     

    8 取整与取余

    double modf (double, double*);  将参数的整数部分通过指针回传, 返回小数部分
    double fmod (double, double);  返回两参数相除的余数
     
     
    source: 《C & C++ Code Capsules》

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://jx-kingwei.spaces.live.com/blog/cns!F7A152EB74B9576E!733.trak
    Weblogs that reference this entry
    • None