ASTM 1.0 FTF Avatar
  1. OMG Issue

ASTM — Describe the behavior of Modulus

  • Key: ASTM-3
  • Legacy Issue Number: 12593
  • Status: closed  
  • Source: Hewlett-Packard ( Faron Dutton)
  • Summary:

    Describe the behavior of Modulus. Some languages find that (-3 mod 2 = 1) and others find that (-3 mod 2 = -1). Recommend adopting the latter since this would align with OCL 2.0 (formal/06-05-01) p.143 context: Integer.mod(i: Integer): Integer post: result = self - (self.div * i)

  • Reported: ASTM 1.0b1 — Sun, 27 Jul 2008 04:00 GMT
  • Disposition: Resolved — ASTM 1.0
  • Disposition Summary:

    The change to the specification will be in section# <3.2.1.5.9>, page# <110>, line# <21>. New description will be added along the lines "Default behavior of Modulus operator: Integer.mod(i: Integer): Integer post: result = self - (self.div * i)".
    A change to specification will also be in section# <2.11.7>, page# <57>, line# <10>. Create a reference to the semantics specified in the section 3.2.1.5.9 (described in previous para).

  • Updated: Fri, 6 Mar 2015 20:57 GMT