From b1fd22f513c2bdad96440c167d45a4634e71e245 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Wed, 22 Mar 2023 13:46:30 +0100 Subject: [PATCH 1/3] Register format decimal128 --- registries/_format/decimal128.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 registries/_format/decimal128.md diff --git a/registries/_format/decimal128.md b/registries/_format/decimal128.md new file mode 100644 index 0000000000..db84bb7cbe --- /dev/null +++ b/registries/_format/decimal128.md @@ -0,0 +1,27 @@ +--- +owner: +issue: +description: A decimal floating-point number with 34 significant decimal digits +base_type: string number +layout: default +--- + +# {{ page.collection }} + +## {{ page.slug }} - {{ page.description }} + +Base type: `{{ page.base_type }}`. + +The `{{page.slug}}` format represents a [128-bit decimal floating-point number](https://en.wikipedia.org/wiki/Decimal128_floating-point_format) as defined by IEEE 754 2008 and ISO/IEC/IEEE 60559:2011. + +{% if page.issue %} +### GitHub Issue + +* [#{{ page.issue }}](https://github.com/OAI/OpenAPI-Specification/issues/{{ page.issue }}) +{% endif %} + +{% if page.remarks %} +### Remarks + +{{ page.issue }} +{% endif %} From 8208b827ebbfa579192fc07e2388609b1d20cef8 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Thu, 23 Mar 2023 09:13:01 +0100 Subject: [PATCH 2/3] Update decimal128.md --- registries/_format/decimal128.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registries/_format/decimal128.md b/registries/_format/decimal128.md index db84bb7cbe..aff96bf292 100644 --- a/registries/_format/decimal128.md +++ b/registries/_format/decimal128.md @@ -2,7 +2,7 @@ owner: issue: description: A decimal floating-point number with 34 significant decimal digits -base_type: string number +base_type: string, number layout: default --- From 2b5729dd0a9cac52edf103b235173d296c5f5616 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Thu, 23 Mar 2023 18:22:24 +0100 Subject: [PATCH 3/3] Apply Darrel's suggestions --- registries/_format/decimal128.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/registries/_format/decimal128.md b/registries/_format/decimal128.md index aff96bf292..b04d92fb5c 100644 --- a/registries/_format/decimal128.md +++ b/registries/_format/decimal128.md @@ -14,6 +14,10 @@ Base type: `{{ page.base_type }}`. The `{{page.slug}}` format represents a [128-bit decimal floating-point number](https://en.wikipedia.org/wiki/Decimal128_floating-point_format) as defined by IEEE 754 2008 and ISO/IEC/IEEE 60559:2011. +Representation as a JSON string is preferred as this avoids problems with recipients that parse JSON numbers into [binary64](https://en.wikipedia.org/wiki/Double-precision_floating-point_format) memory representation. + +String representation allows expressing the special values `NaN`, `-INF`, and `INF` that cannot be expressed as JSON numbers. + {% if page.issue %} ### GitHub Issue