当前位置:网站首页>Attributes and methods in math library
Attributes and methods in math library
2022-07-04 11:07:00 【It's a cinch!】
ceil: Rounding up ——math.ceil(n)
floor: Rounding down ——math.floor(n)
fmod: Remainder —— The sign of the remainder is the same as that of the dividend ——math.fmod(m,n)
modf: return x The integral and fractional parts of , Two parts of the numerical symbols and x identical , The integer part is represented as a floating point ——math.modf(n)
pow: To the power —— The result is floating point —— math.pow(m,n)
sqrt: square root —— The result is floating point ——math.sqrt(n)
isqrt: Round down the square root to the nearest integer —— The result is an integer ——math.isqrt(n)
fabs: Take the absolute value —— The result is floating point ——math.fabs(n) 《==》 abs(n) Take the absolute value —— The result is type and n The same type of
e: constants attribute ——math.e
pi: PI attribute ——math.pi
nan:(not a number)——nan Property is a special value that represents a non numeric value . This property indicates that a value is not a number , In mathematical representation, a number that cannot be represented , There is usually another expression here inf,inf and nan The difference is ,inf Is a floating-point number that exceeds the range of floating-point representation ( Its essence is still a number , It's just that he's infinite , Therefore, floating point numbers cannot be used to represent , such as 1/0), and nan It generally represents a non floating point number ( For example, irrational numbers ).nan and nan The comparison relation of is math.nan != math.nan
isnan: Judge whether it's a number , If n yes nan( Not numbers ), Then return to True , Otherwise return to False .——math.isnan(n)
inf: infinity (infinity Abbreviation ), Represents the maximum range of floating-point numbers ( Or more than double Maximum of type ). for example , When used 0 Divide by an integer and you get a 1.#INF / inf value ; Corresponding , If you use 0 Divide by a negative integer and you will get -1.#INF / -inf value .
Indicates positive and negative infinity : float("inf"), float("-inf")
inequality : When it comes to > and < Operation time , All the numbers are equal to -inf Big ; All the numbers are equal to +inf Small ;
equation : +inf and +inf equal ;-inf and -inf equal
isfinite: Judge whether it is infinite ——math.isfinite(n) ,math.isfinite(n) Method can determine parameters n The numerical . If n Neither infinity nor nan, Then return to True , Otherwise return to False
sin: sine ——math.sin(n)
cos: cosine ——math.cos(n)
tan: tangent ——math.tan(n) square root
'__doc__', '__loader__', '__name__', '__package__', '__spec__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', '', 'comb', 'copysign', '', 'cosh', 'degrees', 'dist', 'erf', 'erfc', 'exp', 'expm1', , 'factorial', 'frexp', 'fsum', 'gamma', 'gcd', 'hypot', 'inf', 'isclose', 'isinf', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'log2', ', '', 'perm' ', 'prod', 'radians', 'remainder', 'sinh', 'tanh', 'tau', 'trunc'
边栏推荐
- DDL language of MySQL database: create, modify alter, delete drop of databases and tables
- 本地Mysql忘记密码的修改方法(windows)[通俗易懂]
- Heartbeat报错 attempted replay attack
- JMeter common configuration components and parameterization
- Canoe test: two ways to create CAPL test module
- iptables导致Heartbeat脑裂
- Canoe: distinguish VT, VN and vteststudio from their development history
- Elevator dispatching (pairing project) ③
- Canoe: the difference between environment variables and system variables
- Capl: timer event
猜你喜欢
[Galaxy Kirin V10] [server] iSCSI deployment
Summary of collection: (to be updated)
Introduction to Lichuang EDA
Appscan installation steps
Deepmind proposed a Zuan AI, which specially outputs network attack language
Application and Optimization Practice of redis in vivo push platform
Canoe - description of common database attributes
Automatic translation between Chinese and English
Installation of ES plug-in in Google browser
[Galaxy Kirin V10] [server] soft RAID configuration
随机推荐
Dictionaries and collections
Canoe - the third simulation project - bus simulation - 3-2 project implementation
The last month before a game goes online
Safety testing aspects
[test theory] test phase analysis (unit, integration, system test)
Performance test overview
re. Sub() usage
Get the data of the top 100 headlines today with Tianxing data
XMIND installation
QQ set group information
CAPL: on sysVar_ Update difference on sysvar
试题库管理系统–数据库设计[通俗易懂]
Jemeter script recording
Failed to configure a DataSource: ‘url‘ attribute is not specified... Bug solution
Canoe - the second simulation engineering - xvehicle - 2 panel design (operation)
SSH原理和公钥认证
Appscan installation steps
thread
Installation of ES plug-in in Google browser
Swagger and OpenAPI