Math Constants

 

http://msdn.microsoft.com/en-us/library/4hwaceh6(v=vs.120).aspx

#define _USE_MATH_DEFINES // for C++
#include <cmath>

#define _USE_MATH_DEFINES // for C
#include <math.h>

 

 

Symbol

Expression

Value

M_E

e

2.71828182845904523536

M_LOG2E

log2(e)

1.44269504088896340736

M_LOG10E

log10(e)

0.434294481903251827651

M_LN2

ln(2)

0.693147180559945309417

M_LN10

ln(10)

2.30258509299404568402

M_PI

pi

3.14159265358979323846

M_PI_2

pi/2

1.57079632679489661923

M_PI_4

pi/4

0.785398163397448309616

M_1_PI

1/pi

0.318309886183790671538

M_2_PI

2/pi

0.636619772367581343076

M_2_SQRTPI

2/sqrt(pi)

1.12837916709551257390

M_SQRT2

sqrt(2)

1.41421356237309504880

M_SQRT1_2

1/sqrt(2)

0.707106781186547524401

 

Math Constants are not defined in Standard C/C++. To use them, you must first define _USE_MATH_DEFINES and then include cmath or math.h.

The file ATLComTime.h includes math.h when your project is built in Release mode. If you use one or more of the math constants in a project that also includes ATLComTime.h, you must define _USE_MATH_DEFINES before you include ATLComTime.h.

 

转载于:https://www.cnblogs.com/qingsiburan/p/4047562.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值