Re: [PR] Fix printDecimal regression for decimal values wide r than a long [poi-xmlbeans]

czpilar (via GitHub) <[email protected]>
Newsgroups gmane.comp.jakarta.poi.devel
Message-ID <PR_kwDOAAQgj88AAAABBIne4w-201ae6aa-7e6a-4ddf-95f4-a938a0cf7873@gitbox.apache.org>
czpilar commented on PR #96:
URL: https://github.com/apache/poi-xmlbeans/pull/96#issuecomment-5431861306

   The negative-scale case reproduces exactly as described - I added the three cases as a test against the operand-swap version first, and 1E+20 failed with the same "Value can't be converted to long". So the swap only narrowed the window rather than closing it.
   
   Switched to signum(). Agreed it is the right level to fix this at: the branch is a zero test, signum() states that directly, and it takes MathUtil off the serialization path. Also dropped the && evaluation-order comment, which no longer applies.
   
   Tests now cover positive scale, negative scale and zero with both signs of scale. XsTypeConverterTest (32), TestMathUtil (14), SchemaTypesTests and NumeralsTests all pass.


-- 
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]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.