-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.0_ERRATA03
-
Fix Version/s: V4.01_WD01
-
Component/s: URL Conventions
-
Labels:None
-
Environment:
[Proposed]
-
Proposal:
The current description of Modulo reads:
"If the right operand is negative, the sign of the result is the same as the sign of the left operand. If the right operand is zero, the request fails."
This leaves (intentionally?) ambiguous what the sign of the result should be if the right operand is positive.
Most programming languages appear to always use the sign of the left operand (C/C+, CoffeeScript, Fortran, Java, JavaScript, PHP, SQL, VB, XBase+,...) while some use the sign of the right operand (Ada, COBOL, Common LISP, Haskell, Excel, PERL, Python, R, Ruby,...) and some return a positive result always, but I didn't find any examples where the result was the sign of the left operand if, and only if, the right operand was negative.
Note that MOST of the languages that use the sign of the right operand have variants for returning the sign of the left operand.
We could specify:
1) Sign is always the sign of the left operand (most commonly supported)
2) Sign is always the sign of the right operand (less commonly supported)
3) Sign is always positive
4) Sign is explicitly undefined