ETSI's Bug Tracker - Part 11: Using JSON with TTCN-3
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0007725 | Part 11: Using JSON with TTCN-3 | [TTCN-3 Change Requests] Clarification | public | 25-10-2017 12:00 | 05-01-2018 09:19

Reporter | nikolajev |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | V4.7.1 (published 2017-06) |
Target Version | V4.8.1 (published 2020-05) | Fixed in Version | V4.8.1 (published 2020-05) |

Summary | 0007725: "Part 11: Using JSON with TTCN-3":"B.3.6 Use the Minus sign" assumptions for TTCN-3 Core Language spec

Description

"B.3.6 Use the Minus sign" makes the assumption that TTCN-3 Core Language specification distinguishes signed +0/-0 integers and +0.0/-0.0 float values.
In TTCN-3 Core Language specification "6.1.0 Simple basic types and values", under:
"a) integer: ..." it is stated that "the value zero shall be represented by a single zero" without specifying that it must be signed.
float type description does not indicate any requirements for signed 0.0 value.

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | CR7725.docx (144,285) 26-10-2017 10:14 http://oldforge.etsi.org/mantis/file_download.php?file_id=3707&type=bug CR7725-v2.docx (162,983) 26-10-2017 13:38 http://oldforge.etsi.org/mantis/file_download.php?file_id=3715&type=bug

Issue History
Date Modified | Username | Field | Change
25-10-2017 12:00 | nikolajev | New Issue |
26-10-2017 09:53 | KristÃ³f Szabados | Note Added: 0014879 |
26-10-2017 09:53 | KristÃ³f Szabados | Assigned To | => KristÃ³f Szabados
26-10-2017 09:53 | KristÃ³f Szabados | Status | new => assigned
26-10-2017 09:56 | KristÃ³f Szabados | Note Added: 0014880 |
26-10-2017 10:02 | KristÃ³f Szabados | Status | assigned => confirmed
26-10-2017 10:14 | KristÃ³f Szabados | File Added: CR7725.docx |
26-10-2017 10:18 | KristÃ³f Szabados | Assigned To | KristÃ³f Szabados => Tomas Urban
26-10-2017 10:18 | KristÃ³f Szabados | Status | confirmed => assigned
26-10-2017 10:18 | KristÃ³f Szabados | Status | assigned => confirmed
26-10-2017 13:38 | Tomas Urban | File Added: CR7725-v2.docx |
26-10-2017 13:41 | Tomas Urban | Note Added: 0014891 |
26-10-2017 13:41 | Tomas Urban | Assigned To | Tomas Urban => KristÃ³f Szabados
27-10-2017 12:40 | KristÃ³f Szabados | Note Added: 0014914 |
27-10-2017 12:40 | KristÃ³f Szabados | Status | confirmed => resolved
27-10-2017 12:40 | KristÃ³f Szabados | Resolution | open => fixed
27-10-2017 12:40 | KristÃ³f Szabados | Assigned To | KristÃ³f Szabados => Gyorgy Rethy
04-01-2018 17:01 | Gyorgy Rethy | Project | TTCN-3 Change Requests => Part 11: Using JSON with TTCN-3
05-01-2018 09:19 | Gyorgy Rethy | Note Added: 0014999 |
05-01-2018 09:19 | Gyorgy Rethy | Status | resolved => closed
05-01-2018 09:19 | Gyorgy Rethy | Product Version | => V4.7.1 (published 2017-06)
05-01-2018 09:19 | Gyorgy Rethy | Fixed in Version | => V4.8.1 (published 2020-05)
05-01-2018 09:19 | Gyorgy Rethy | Target Version | => V4.8.1 (published 2020-05)

Notes

(0014879)
KristÃ³f Szabados
26-10-2017 09:53

For float values the core standard allows the mantissa to be a negative integer.
C.1.29 also gives an example:
"str2float("-0.0") // returns a float value equal to -0.0"
In section 7.1.3 Relational Operators states
"Two floating-point numbers are equal if and only if they contain the same value. The values minus zero and
plus zero are two distinct values (e.g. they are encoded differently in some standardized languages) and minus
zero is less than plus zero, which represents zero."

(0014880)
KristÃ³f Szabados
26-10-2017 09:56

Section B.3.6 (Use the Minus sign) describes how to decode the different zero kinds by default and using the "useMinus" encoding instruction. But this part also describes that the -0 JSON value to be decoded as a negative 0 in TTCN-3. during STF discussion we decided to change this so that the -0 JSON value is decoded into the -0.0 TTCN-3 value.

(0014891)
Tomas Urban
26-10-2017 13:41

I made some additional changes to the text: 1. Minus sign is always discarded during decoding of integer types 2. The user has an option to use a float-point type instead (there's a note about that) 3. The "useMinus" instruction is available for a float-point type values only.

(0014914)
KristÃ³f Szabados
27-10-2017 12:40

looks good to me.

(0014999)
Gyorgy Rethy
05-01-2018 09:19

Implemented with slight modification: first sentence in B.3.6 is clarified;
old text: "By default, TTCN-3 values of JSON.Number and JSON.Integer and IEEE 754 float useful types are decoded by their values, i.e. ..." (but in fact JSON values are decoded TO JSON.Number ... types).
new text: "By default, without the “useMinus” instruction, JSON numbers are decoded to TTCN-3 JSON.Number and IEEE 754 float useful types by their values; i.e. ..."