The PER Real codec does not handle special cases such as '-0.0' or 'NaN' according to the Rec. ITU-T X.690 (02/2021) standard (get it from here).
Special cases that are implemented (in C, ada?):
[x] Positive Infinity
[x] Negative Infinity
[x] Zero
[x] Minus Zero (Chapter 8.5.3)
[x] Not A Number (Chapter 8.5.9)
If the double value MINUS_ZERO is encoded and decoded, the MINUS is lost in translation. This should not lead to massive problems in reality, but should still be integrated because the standard holds a special case for it.
NaN is not implemented at all in C (and ada?) - hence the exponent and the mantissa get exported from the NaN double / float bitstring. If an PER based decoder reads a stream created by our encoder, it could lead to a crash because the asumption is met that there is no NaN after a certain point.
This was already implemented in the Scala backend - I added all links here :)
The PER Real codec does not handle special cases such as '-0.0' or 'NaN' according to the Rec. ITU-T X.690 (02/2021) standard (get it from here).
Special cases that are implemented (in C, ada?):
If the double value MINUS_ZERO is encoded and decoded, the MINUS is lost in translation. This should not lead to massive problems in reality, but should still be integrated because the standard holds a special case for it.
NaN is not implemented at all in C (and ada?) - hence the exponent and the mantissa get exported from the NaN double / float bitstring. If an PER based decoder reads a stream created by our encoder, it could lead to a crash because the asumption is met that there is no NaN after a certain point.
This was already implemented in the Scala backend - I added all links here :)
Encoding method (C backend): https://github.com/maxime-esa/asn1scc/blob/1ddce9cea6001ffe76b86db144777321385b4203/asn1crt/asn1crt_encoding.c#L1119 Encoding method (Scala backend): https://github.com/ateleris/asn1scc/blob/d02c9a967fedbac046d18efc7f0b5b4ad5369b61/asn1scala/src/main/scala/asn1scala/asn1jvm_Codec.scala#L418
Decoding method (C backend): https://github.com/maxime-esa/asn1scc/blob/1ddce9cea6001ffe76b86db144777321385b4203/asn1crt/asn1crt_encoding.c#L1187 Decoding method (Scala backend): https://github.com/ateleris/asn1scc/blob/d02c9a967fedbac046d18efc7f0b5b4ad5369b61/asn1scala/src/main/scala/asn1scala/asn1jvm_Codec.scala#L510C29-L510C29