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.1a2.tar.gz
(8.5 kB
view hashes)
Built Distribution
Close
Hashes for num_tini4-0.0.1a2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8da0aee2879ad0d80a094a6b483fd88ee5b88ad657681b73b9aee219bc1cc8d3 |
|
MD5 | bd79965f9bd5e21abed2812b9042bdc1 |
|
BLAKE2b-256 | f9ab3c325e810f77f5834c9fcdf568ff8b899d25d0e577ac3cef195346b774a6 |