[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

*Subject*: **[OASIS Issue Tracker] (ODATA-1004) Sign of Modulo for positive right operand**

*From*:**OASIS Issues Tracker <workgroup_mailer@lists.oasis-open.org>***To*: odata@lists.oasis-open.org*Date*: Thu, 17 Nov 2016 01:11:14 +0000 (UTC)

[ https://issues.oasis-open.org/browse/ODATA-1004?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Pizzo updated ODATA-1004: --------------------------------- Description: 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 was: 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 undefined or leave it undefined > Sign of Modulo for positive right operand > ----------------------------------------- > > Key: ODATA-1004 > URL: https://issues.oasis-open.org/browse/ODATA-1004 > Project: OASIS Open Data Protocol (OData) TC > Issue Type: Bug > Components: OData URL Conventions > Affects Versions: V4.0_ERRATA03 > Environment: [Proposed] > Reporter: Michael Pizzo > Fix For: V4.01_WD01 > > > 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 -- This message was sent by Atlassian JIRA (v6.2.2#6258)

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]