Skip to content

Conversation

nirosys
Copy link
Contributor

@nirosys nirosys commented Sep 9, 2025

This PR is based off of the changes in #996

Issue #, if available: #943

Description of changes:
This PR implements tagless floats, both float32, and float64.

CLI Testing

Below is the output of ion inspect of the definition and evocation of the following macro:

(macro foo (float32::a float64::b) 
     [(%a), (%b)]
)
┌──────────────┬──────────────┬─────────────────────────┬──────────────────────┐
│    Offset    │    Length    │       Binary Ion        │       Text Ion       │
├──────────────┼──────────────┼─────────────────────────┼──────────────────────┘
│            0 │            4 │ e0 01 01 ea             │ $ion_1_1 // Version marker
├──────────────┼──────────────┼─────────────────────────┤
│            4 │            6 │ e7 f9 24 69 6f 6e       │ $ion:: // <text>
│           10 │           64 │ fc 7d                   │ (
│           12 │            2 │ ee 10                   │ · module
│           14 │            2 │ a1 5f                   │ · _
│           16 │            5 │ c4                      │ · (
│           17 │            2 │ ee 0f                   │ · · symbol_table
│           19 │            2 │ a1 5f                   │ · · _
│              │              │                         │ · )
│           21 │           53 │ fc 67                   │ · (
│           23 │            2 │ ee 0e                   │ · · macro_table
│           25 │            2 │ a1 5f                   │ · · _
│           27 │           47 │ fc 5b                   │ · · (
│           29 │            6 │ a5 6d 61 63 72 6f       │ · · · macro
│           35 │            4 │ a3 66 6f 6f             │ · · · foo
│           39 │           24 │ fc 2d                   │ · · · (
│           41 │            9 │ e7 f3 66 6c 6f 61 74 33 │ · · · · float32:: // <text>
│           50 │            2 │ a1 61                   │ · · · · a
│           52 │            9 │ e7 f3 66 6c 6f 61 74 36 │ · · · · float64:: // <text>
│           61 │            2 │ a1 62                   │ · · · · b
│              │              │                         │ · · · )
│           63 │           11 │ ba                      │ · · · [
│           64 │            5 │ c4                      │ · · · · (
│           65 │            2 │ a1 25                   │ · · · · · '%'
│           67 │            2 │ a1 61                   │ · · · · · a
│              │              │                         │ · · · · ),
│           69 │            5 │ c4                      │ · · · · (
│           70 │            2 │ a1 25                   │ · · · · · '%'
│           72 │            2 │ a1 62                   │ · · · · · b
│              │              │                         │ · · · · ),
│              │              │                         │ · · · ]
│              │              │                         │ · · )
│              │              │                         │ · )
│              │              │                         │ )
├──────────────┼──────────────┼─────────────────────────┤
│           74 │           13 │ 18                      │ (:foo
│           75 │            4 │ 1f 85 ab 3f             │ · 1.340000033378601e0 // a
│           79 │            8 │ b8 1e 85 eb 51 b8 16 40 │ · 5.68e0 // b
│              │              │                         │ )
│              │              │                         │ [
│              │              │                    (%a) │ · 1.340000033378601e0,
│              │              │                    (%b) │ · 5.68e0,
│              │              │                         │ ]
├──────────────┼──────────────┼─────────────────────────┤
│           87 │              │                         │  // End of stream
└──────────────┴──────────────┴─────────────────────────┘

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@nirosys nirosys marked this pull request as ready for review September 10, 2025 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant