Specification: Rational Numbers (OSCAR v1.6-v1.8)
Profiles: OSCAR v1.6, OSCAR v1.7, OSCAR v1.8
Other versions: Rational Numbers (OSCAR v1.0-v1.5)
From OSCAR v1.6 onward, rational numbers are represented as typed values whose
payload is a textual fraction such as "42//23". The field context is part of
the type.
Encoding rules
- Use a typed encoding such as
QQFieldElemrather than a bare JSON number. - Store the rational value under
datausing the profile's textual normal form. - Record the ambient field in
_type.paramswhen required by the profile.
Canonical Example Payload
The following payload is taken directly from the current rosetta-stone corpus.
{
"_ns": {"Oscar": ["https://github.com/oscar-system/Oscar.jl", "1.7.0"]},
"_type": {"name": "QQFieldElem", "params": {"_type": "QQField"}},
"data": "42//23"
}
Documented Profiles in This Corpus
This table records the profile/version pairs currently represented by the rosetta-stone examples for this data type. Add new rows as new systems or encoding revisions are documented.
| Profile | Version | Example | Root type |
|---|---|---|---|
| Oscar | 1.6.0 |
Rational number | QQFieldElem |
| Oscar | 1.7.0 |
Rational number | QQFieldElem |