mbeckerle commented on code in PR #1337:
URL: https://github.com/apache/daffodil/pull/1337#discussion_r1819728642
##########
daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/unparsers/runtime1/BinaryNumberUnparsers.scala:
##########
@@ -268,6 +317,10 @@ abstract class BinaryDecimalUnparserBase(
nBits: Int,
finfo: FormatInfo
): Boolean = {
- dos.putBigInt(asBigInt(value), nBits, signed == YesNo.Yes, finfo)
+ if (nBits > 0) {
+ dos.putBigInt(asBigInt(value), nBits, signed == YesNo.Yes, finfo)
Review Comment:
type xs:decimal with binaryNumberRep "binary" is a signed integer that is
then scaled by binaryDecimalVirtualPoint.
Before the scaling, I think it behaves exactly like xs:integer. For signed,
it must have 2 bits. Unsigned (which is what property dfdl:decimalSigned
controls - despite the DFDL spec not providing adequate description of the
property) means you must have at least 1 bit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]