Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tohil tclobj integer math always at 64 bits; Faster Python-to-Tcl numeric conversions; TclProcs now return tclobj by default #75

Merged
merged 9 commits into from
Nov 23, 2021
Prev Previous commit
Next Next commit
add note about bignums and tclobj 64-bit calculation limits
  • Loading branch information
lehenbauer committed Nov 20, 2021
commit 4ba485ed4a0d7e325bc1dd42e17fc67a5c057b3b
14 changes: 14 additions & 0 deletions Doc/reference/tohil_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ float.
Tohil will raise a TypeError exception if the Tcl object
can't be converted to the Python type that's needed.

Both Python and Tcl support arbitrarily large numbers, and
you can freely assign tclobjs from arbitrarily large numbers produced
by Python, and vice versa.

Note that Python calculations performed using Tohil's tclobjs are
limited to 64 bits (or whatever width a C language "long long" is on the
machine tohil was compiled for.) While this should be fine in
the overwhelming majority of cases, if you are manipulating numbers
that are wider than 64 bits (i.e. less than
-9,223,372,036,854,775,808 or greater than 9,223,372,036,854,775,807),
you will need to move them from tclobjs to native Python ints, first,
by invoking ``int()`` on the tclobjs of interest.


.. _tohil_bitstring-ops:

=================================
Expand Down