-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbsPowMaxMinRoundOperators.py
More file actions
55 lines (52 loc) · 1.25 KB
/
AbsPowMaxMinRoundOperators.py
File metadata and controls
55 lines (52 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
print("""print absoloute value of a number
num1=-5
print(abs(num1))
""")
num1=-5
print(abs(num1))
print("""give power to a value or a number
print(pow(3,2))
print(3**2)
""")
print(pow(3,2))
print(3**2)
print('''
''')
print('''
print(max(4,7))
''')
print(max(4,7))
print('''
print(min(4,7))
''')
print(min(4,7))
print('''
print(round(4,7))
print(round(9,3))
print(round(9,5))
''')
print(round(4,7))
print(round(9,3))
print(round(9,5))
print('''
print(round(4.7))
print(round(9.3))
print(round(9.6))
print(round(9.5))
''')
print(round(4.7))
print(round(9.3))
print(round(9.6))
print(round(9.5))
print('''
Floor Division(//) - The division of operands where the result is the quotient
in which the digits after the decimal point are removed. But if one of the
operands is negative, the result is floored, i.e.,
rounded away from zero (towards negative infinity): examples: 9//2 = 4 and
9.0//2.0 = 4.0, -11//3 = -4, -11.0//3 = -4.0
Towards infinity and away from zero are different things.
Example for (-1.2 and 3.4): "flooring" is towards
negative infinity (-2 and 3), "truncating" is towards zero
(-1 and 3), "saturating" is away from zero (-2 and 4),
and "ceiling" is towards positive infinity (-1 and 4).
''')