Python precise number type.
Project description
Example Package
This is a simple example package. You can use Github-flavored Markdown to write your content.
Num
Python precise number type.
from src.Num_Tini4.num import Num
number1 = Num()
number2 = Num()
number1.set_num({2: 1, 3: 2}, sign=Num.Sign.NEGATIVE) # 18
number2.set_num({11: -1}) # 1/11
print((number2 + number1).get_fraction()) # 199/11
print()
print(abs(number1))
number1.set_float(18 / 11)
print(18 / 11)
print(number1.get_float())
print(number1)
print(number1.get_fraction())
print()
number1.set_float(-18 / 11)
print(number1)
print(number1.get_float())
print(-18 / 11)
number1.set_int(3)
number2.set_int(2)
print((number1 ** number2).get_float())
1
- http://www.java2s.com/Tutorials/Python/Class/Overload_divide_operator.htm
- https://www.geeksforgeeks.org/operator-overloading-in-python/
2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
num_tini4-0.0.1a1.tar.gz
(8.5 kB
view hashes)
Built Distribution
Close
Hashes for num_tini4-0.0.1a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe7ae9d9a00b7094bb052dd1a6414079baeff2856cc640ad79d31172aa36a9da |
|
MD5 | 15259310df2ee46a42d09f05faefb24f |
|
BLAKE2b-256 | 8cb79bb6fb00964393ac0d82b95a7ab98c719c6611b3ac1f0b23294616975720 |