Why does xs:dayTimeDuration('PT0.001S') * 60000 * 60 give PT0.817405952S?
Replies (2)
Please register to reply
Added by Martin Honnen over 2 years ago
I am kind of confused why Saxon Java and CS give a strange result for xs:dayTimeDuration('PT0.001S') * 60000 * 60
:
PS C:\Users\marti> & 'C:\Program Files\Saxonica\SaxonCS-11.3\SaxonCS.exe' query -qs:"xs:dayTimeDuration('PT0.001S') * 60000 * 60"
<?xml version="1.0" encoding="UTF-8"?>PT0.817405952S
With BaseX or Saxon-JS I get PT1H
.
Good catch. It's an overflow in 32-bit int arithmetic occurring in DayTimeDurationValue.multiply()
For the record, this was handled under https://saxonica.plan.io/issues/5461
Please register to reply