@@ -159,40 +159,41 @@ together with the resolved options' values.
159
159
160
160
The _function_ `:integer` performs selection as described in [Number Selection](#number-selection) below.
161
161
162
- #### The `:math ` function
162
+ #### The `:offset ` function
163
163
164
- > [!IMPORTANT]
165
- > The _function_ `:math` has a status of **Draft**.
166
- > It is proposed for inclusion in a future release of this specification and is not Stable.
167
-
168
- The _function_ `:math` is proposed as a _selector_ and _formatter_ for matching or formatting
169
- numeric values to which a mathematical operation has been applied.
164
+ The _function_ `:offset` is a _selector_ and _formatter_ for matching or formatting
165
+ numeric values to which an offset has been applied.
166
+ The "offset" is a small integer adjustment of the _operand_'s value.
170
167
171
168
> This function is useful for selection and formatting of values that
172
169
> differ from the input value by a specified amount.
173
- > For example, it can be used in a message such as this:
170
+ > For example, it can be used in a _message_ such as this:
174
171
>
175
172
> ```
176
173
> .input {$like_count :integer}
177
- > .local $others_count = {$like_count :math subtract=1}
174
+ > .local $others_count = {$like_count :offset subtract=1}
178
175
> .match $like_count $others_count
179
176
> 0 * {{Your post has no likes.}}
180
177
> 1 * {{{$name} liked your post.}}
181
178
> * one {{{$name} and {$others_count} other user liked your post.}}
182
179
> * * {{{$name} and {$others_count} other users liked your post.}}
183
180
> ```
184
181
185
- ##### Operands
182
+ > [!NOTE]
183
+ > The purpose of this _function_ is to supply compatibility with
184
+ > ICU's `PluralFormat` and its `offset` feature, also found in ICU MessageFormat.
186
185
187
- The function `:math` requires a [Number Operand](#number-operands) as its _operand_.
186
+ ##### `:offset` Operands
188
187
189
- ##### Options
188
+ The function `:offset` requires a [Number Operand](#number-operands) as its _operand_.
189
+
190
+ ##### `:offset` Options
190
191
191
- The _options_ on `:math ` are exclusive with each other,
192
+ The _options_ on `:offset ` are exclusive with each other,
192
193
and exactly one _option_ is always required.
193
194
The _options_ do not have default values.
194
195
195
- The following _options_ are REQUIRED to be available on the function `:math `:
196
+ The following _options_ are REQUIRED to be available on the function `:offset `:
196
197
197
198
- `add`
198
199
- _digit size option_
@@ -204,9 +205,9 @@ or if an _option value_ is not a _digit size option_,
204
205
a _Bad Option_ error is emitted
205
206
and a _fallback value_ used as the _resolved value_ of the _expression_.
206
207
207
- ##### Resolved Value
208
+ ##### `:offset` Resolved Value
208
209
209
- The _resolved value_ of an _expression_ with a `:math ` _function_
210
+ The _resolved value_ of an _expression_ with a `:offset ` _function_
210
211
contains the implementation-defined numeric value
211
212
of the _operand_ of the annotated _expression_.
212
213
@@ -222,18 +223,18 @@ If the _operand_ of the _expression_ is an implementation-defined numeric type,
222
223
such as the _resolved value_ of an _expression_ with a `:number` or `:integer` _annotation_,
223
224
it can include option values.
224
225
These are included in the resolved option values of the _expression_.
225
- The `:math ` _options_ are not included in the resolved option values.
226
+ The `:offset ` _options_ are not included in the resolved option values.
226
227
227
228
> [!NOTE]
228
- > Implementations can encounter practical limits with `:math ` _expressions_,
229
+ > Implementations can encounter practical limits with `:offset ` _expressions_,
229
230
> such as the result of adding two integers exceeding
230
231
> the storage or precision of some implementation-defined number type.
231
232
> In such cases, implementations can emit an _Unsupported Operation_ error
232
233
> or they might just silently overflow the underlying data value.
233
234
234
- ##### Selection
235
+ ##### `:offset` Selection
235
236
236
- The _function_ `:math ` performs selection as described in [Number Selection](#number-selection) below.
237
+ The _function_ `:offset ` performs selection as described in [Number Selection](#number-selection) below.
237
238
238
239
#### The `:currency` function
239
240
0 commit comments