<img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=4138537&amp;fmt=gif">
Skip to content
English
  • There are no suggestions because the search field is empty.

div

Method returns the integer quotient of the division of the given value and the parameter.

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. 

<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>