Best IEEE 754-1985 Performance for X3.9-1978 Standard

According to the DICOM standard, a floating point type can be stored using a representation of decimal string values. See Table 6.2-1. Representations of DICOM values :

Decimal string: A character string representing either a fixed point number or a floating point number. The fixed-point number must contain only characters 0–9 with the optional leading character “+” or “-,” and optional “.”. to mark the decimal point. Floating-point numbers must be transmitted, as defined in ANSI X3.9, from "E" or "e" to indicate the beginning of the exponent. Decimal lines can be padded with leading or trailing spaces. Nested spaces are not allowed.

"0" - "9", "+", "-", "E", "e", "." and the default SPACE value. Character repertoire. 16 bytes maximum

Therefore, I would like to simply use 64 bits double( IEEE 754-1985) to represent the value in memory in my code based on the fact that the input is stored for a maximum of 16 bytes.

Can someone with little knowledge X3.9-1978confirm that this is the best possible idea (compared to arbitrary-precision, floatand / or long double)? In the best case, I mean that the view was in the opposite direction, reading / writing would be visually lossless. I would have to read such an ASCII floating point representation from disk, put it into memory and write back to disk (as indicated above) with maximum accuracy compared to the original values ​​(= machine epsilon, when possible). Actual information on how to represent doubleASCII with only 16 bytes of storage is beyond the scope of this question, see here for details.

+4
1

.

, . , .

DICOM 16 , 15-16 (ref.). (+/-), (.) (e/E), 15 , . , 16 . , : 16- 9999999999999997 9999999999999996 float IEEE 754.

TL/DR: : " 16 " [] - , . DICOM , .


: , IEEE 754, , , 1e1024 DICOM Decimal String, ( 1e308).

+4

Source: https://habr.com/ru/post/1607807/


All Articles