Skip to main content

A package to use OrdinnalNumber

Project description

This package is for ordinal numbers. Ordered numbers are a concept from set theory that extends the natural numbers to compare the "length" of aligned sets. This library implements ordered numbers: sum, difference (left-hand inverse), product, quotient (left-hand inverse), truncation, division, remainder, comparison of sizes, square root, etc. If I have enough power, I will also create "log", "n-square root" and "factorial". If requested, I will make others. (my Email:alphagameplayerpro$gmail.com (please replace $ to @))

And,
```
omega = ordinal_number.OMEGA
```
at the beginning of the program. That way, it is intuitive and the output of repr() can be executed as is.


References
http://www.behounek.online/logic/papers/ordcalc/index.html
https://proofwiki.org/wiki/Division_Theorem_for_Ordinals#Existence_of_%7F'%22%60UNIQ-MathJax-9-QINU%60%22'%7F_and_%7F'%22%60UNIQ- MathJax-10-QINU%60%22'%7F
https://manabitimes.jp/math/1318 (Japanese site)

examples

improt ordinal-number as ord

omega = ord.OMEGA

#__add__
omega+1+omega+omega+1
#>>> omega*2+1

#__sub__ A-B := (X such that B+X=A) if not exists, return None
(omrga**2*2+omega*2+1)-omega**2
#>>> omega**2+omega*2+1
(omega*2+1)-omega**2
#>>> None

#__mul__
(omega+1)*(omega+1)
#>>> omega**2+omega+1

#__truediv__ A/B := (X such that B*X=A) if not exists, return None
(omega**2+omega+1)/(omega+1)
#>>> omega+1
(omega**2+omega+1)/omega
#>>> None

#__floordiv__ A//B := (X such that B*X+Y=A ,0<=Y<B)
(omega**2+omega+1)//(omega+1)
#>>> omega+1
(omega**2+omega+1)//omega
#>>> omega+1

#__truediv__ A%B := (Y such that B*X+Y=A ,0<=Y<B)
(omega**2+omega+1)%(omega+1)
#>>> 0
(omega**2+omega+1)%omega
#>>> 1

#__pow__
(omega+1)**2
#>>> omega**2+omega+1
2**omega
#>>> omega
omega**2
#>>> omega

#sqrt(self)
(omega**2+omega+1).sqrt()
#>>> omega+1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ordinal_number-0.2.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ordinal_number-0.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file ordinal_number-0.2.tar.gz.

File metadata

  • Download URL: ordinal_number-0.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for ordinal_number-0.2.tar.gz
Algorithm Hash digest
SHA256 c3542d20d4f1513c1f86d585aaef35003c045ec955d690525cd3ef681c3ef23b
MD5 29f66da36d8ed9800068a9748164a04f
BLAKE2b-256 971d09eb4c581582bbe1e48377885f98b65e7519ecac03f06be3f97e82f16b00

See more details on using hashes here.

File details

Details for the file ordinal_number-0.2-py3-none-any.whl.

File metadata

  • Download URL: ordinal_number-0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for ordinal_number-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a17b454bef3b255d0ef2a0dfa3b1da938c544d6cd128da70e891517ae390f92
MD5 759e94d98a533be5c6a3559b3ffd993f
BLAKE2b-256 d259b3132450577f8596ffae8c6579d4262ddcf5216021ec55d3020c98f89982

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page