typst / typst/typst

Support Arbitrary-precision Numbers and Arithmetic

Open
#8,596 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request scripting
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.