Skip to content

Commit

Permalink
Merge pull request #75 from flightaware/long-long
Browse files Browse the repository at this point in the history
Tohil tclobj integer math always at 64 bits; Faster Python-to-Tcl numeric conversions; TclProcs now return tclobj by default
  • Loading branch information
lehenbauer authored Nov 23, 2021
2 parents 6d86fac + 4ea0f7f commit 45cf99b
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 146 deletions.
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
Loading

0 comments on commit 45cf99b

Please sign in to comment.