Support Arbitrary-precision Numbers and Arithmetic
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 56.1k
- Forks
- 1.7k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Description
Description
It would be nice if typst would support arbitrary-precision arithmetic so you could do data analysis like in python and don't have to care about the implementation detail in using 64 bit integer of typst.
I understand that native data types like 64 bit integers might be more elegant in the implementation and are more efficient, but this should be nothing a user of typst should need to worry about. If python can do it maybe typst should as well. This might open new use-cases for typst.
This might be implemented as another number type besides int, float and decimal or might replace all of those types.
I have been using typst for years and really enjoy using it.
This is maybe similar to #3363
Use Case
I want to be able to do data analysis right in my typst document.
This way I have the code for typesetting my formula right besides code that can perform my formula in one place, similar to literate programming like org-mode or a jupyter notebook.
Unfortunately typst only allows numbers that fit in a 64 bit integer.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the related issue #3363 and reviewing how Typst's int, float, and decimal values currently handle 64-bit limits. Define the supported arbitrary-precision number behavior and arithmetic needed for in-document data analysis, then verify that the resulting design covers values beyond 64-bit integers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100