1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Arbitrary-precision number types — string-preserving, no arithmetic.
//!
//! Both [`BigInteger`] and [`BigReal`] are thin newtypes around a digit `String`
//! exactly as it appears on the WXF wire. They preserve the textual representation
//! losslessly so the value round-trips byte-for-byte through serialization, but
//! they do **not** parse the value into a Rust arithmetic type. If you want to
//! compute on a deserialized BigInteger, parse it yourself:
//!
//! ```ignore
//! let bi = match expr.kind() { ExprKind::BigInteger(n) => n, _ => unreachable!() };
//! let value: num_bigint::BigInt = bi.0.parse().unwrap();
//! let result = value * 2;
//! let back = BigInteger(result.to_string());
//! ```
//!
//! This keeps `wolfram-expr` dependency-free with respect to bignum crates —
//! arithmetic is a higher-level concern.
/// Wolfram Language `BigInteger` — arbitrary-precision integer carried as its
/// textual decimal representation (e.g. `"99999999999999999999999"`).
;
/// Wolfram Language `BigReal` — arbitrary-precision real carried as its WL
/// textual representation, including any precision/accuracy markers
/// (e.g. `"3.14159265358979323846`50."`).
;