You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While testing example Metaschema modules for usnistgov/metaschema#530, I was unable to correctly use mod to compute the remainder of integer division between two numeric values. Debugging indicates there is an issue with the implementation of op:numeric-mod (aliased to mod like in XPath 3.0, this holds for Metapath), potentially in the context that handles decimal precision (review the straightforward implementation code for the function, it is unclear how else there can be a bug, but further investigation needed).
Who is the bug affecting?
Developers of Metaschema modules or Metaschema-enabled tools who need functioning numeric operations (including mod) for advanced constraint usage.
What is affected by this bug?
Any field or flag element in core Metaschema syntax where a module developer can use mod to constrain model requirements (currently, that is most impactful for @target and @test on relevant constraint types).
Paired with @david-waltermire and it turns out it is mapping the mod expression to the correct function from the core parser handler driven by the ANTLR grammar (in BuildCSTVisitor). I will update the issue with the broken tests to explain the bug and then make it a fix branch once I am done with the small, tactical PR. 😄
Describe the bug
While testing example Metaschema modules for usnistgov/metaschema#530, I was unable to correctly use
mod
to compute the remainder of integer division between two numeric values. Debugging indicates there is an issue with the implementation ofop:numeric-mod
(aliased tomod
like in XPath 3.0, this holds for Metapath), potentially in the context that handles decimal precision (review the straightforward implementation code for the function, it is unclear how else there can be a bug, but further investigation needed).Who is the bug affecting?
Developers of Metaschema modules or Metaschema-enabled tools who need functioning numeric operations (including
mod
) for advanced constraint usage.What is affected by this bug?
Any field or flag element in core Metaschema syntax where a module developer can use
mod
to constrain model requirements (currently, that is most impactful for@target
and@test
on relevant constraint types).When does this occur?
Consistently.
How do we replicate the issue?
{What are the steps to reproduce the behavior?
Expected behavior (i.e. solution)
Modulo division would successfully divide [the official examples test vectors for Metapath matching the
op:mod-numeric
examples inputs and function outputs.Other Comments
N/A
The text was updated successfully, but these errors were encountered: