Page last modified 11:42, 29 May 2018 by villes

div

    Table of contents

    Description of the method

     

    Description: div method returns the integer quotient of the division of the given value and the parameter.
    Available for: integer
    Parameters: integer
    Return type: integer

     

    Example

    Context: HeaderType1
    OCL: self.Id.toInteger() div 9 = 3
    Description: The example rule compares the integer quotient of the division of the <Id> and 9 to the integer 3. If the integer quotient is 3, true will be returned. Notice the syntax is different from the normal syntax of methods. 


    The XML snippet below would pass this check.

    <Id>27</Id>

    Also the XML snippet below would pass this check. (35/9=3.89)

    <Id>35</Id>

    The snippet below however would not pass this check. (9/9=1 and it's not equal to 3) 

    <Id>9</Id>

    Menu