Spec: clarification needed for remainder operator on float operands #682
Labels
K-clarification
(Kind) Clarifications regarding the WDL specification.
S02-needs-owner
(State) An issue that needs an individual to write an RFC.
Currently the remainder
%
operator (i.e. modulo) is accepting ofInt
andFloat
as operand types.For two
Int
types, there is no question as to how the operation should be performed as it involves only integer division, e.g.a - ((a / b) * b)
, wherea / b
naturally truncates.However, for
Float
operands orInt
operands implicitly coerced toFloat
because the other operand isFloat
, floating point division is involved and there are several different methods for performing the operation.I would assume the intention is to define the operator in terms of truncation to align with most programming languages, but some notable languages are flooring instead (e.g. Python, Ruby), so an explicit clarification is probably required for the WDL specification.
The text was updated successfully, but these errors were encountered: