当前位置:网站首页>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'

边栏推荐
- Usage of case when then else end statement
- Elevator dispatching (pairing project) ②
- [advantages and disadvantages of outsourcing software development in 2022]
- QQ get group link, QR code
- Detailed array expansion analysis --- take you step by step analysis
- Performance features focus & JMeter & LoadRunner advantages and disadvantages
- The most ideal automated testing model, how to achieve layering of automated testing
- Function introduction of canbedded component
- Canoe - the third simulation project - bus simulation - 3-1 project implementation
- Const's constant member function after the function; Form, characteristics and use of inline function
猜你喜欢

Introduction to Lichuang EDA

Climb Phoenix Mountain on December 19, 2021
![[Galaxy Kirin V10] [server] NUMA Technology](/img/9b/65466c6fc6336e27e842f50c26b9c3.jpg)
[Galaxy Kirin V10] [server] NUMA Technology
![[machine] [server] Taishan 200](/img/e5/69a1a4ca04814a033a77d3cb4601b3.jpg)
[machine] [server] Taishan 200

QQ group collection

Digital simulation beauty match preparation -matlab basic operation No. 6

Canoe - description of common database attributes

Simple understanding of seesion, cookies, tokens

Using SA token to solve websocket handshake authentication
![[Galaxy Kirin V10] [desktop] FTP common scene setup](/img/f6/e4fbfe69a6a7635ee6364114c46fd8.jpg)
[Galaxy Kirin V10] [desktop] FTP common scene setup
随机推荐
Usage of with as
[Galaxy Kirin V10] [desktop] printer
2022 AAAI fellow release! Yan Shuicheng, chief scientist of sail, and Feng Yan, Professor of Hong Kong University of science and technology, were selected
Elevator dispatching (pairing project) ④
JMeter correlation technology
QQ set group information
Learning XML DOM -- a typical model for parsing XML documents
Function introduction of canbedded component
[Galaxy Kirin V10] [server] set time synchronization of intranet server
20 minutes to learn what XML is_ XML learning notes_ What is an XML file_ Basic grammatical rules_ How to parse
Day7 list and dictionary jobs
For and while loops
SQL greatest() function instance detailed example
Get the data of the top 100 headlines today with Tianxing data
Solaris 10网络服务
regular expression
JMeter assembly point technology and logic controller
2022 ape circle recruitment project (software development)
守护进程Xinted和日志记录Syslogd
Canoe: distinguish VT, VN and vteststudio from their development history