Difference between revisions of "Div (Float function)"

From m204wiki
Jump to navigation Jump to search
Line 30: Line 30:
[[List of Intrinsic Float Methods]]
[[List of Intrinsic Float Methods]]
[[Category: Intrinsic Float methods|Round function]]  
[[Category:Intrinsic Float methods]]  
[[Category: Intrinsic methods]]
[[Category:Intrinsic methods]]
[[Category:System methods]]
[[Category:System methods]]

Revision as of 21:18, 10 December 2010

This intrinsic function returns the integer part of the result of dividing the method object by the method argument.

The numbers to be divided are first rounded to the nearest integer, including zero. Any remainder from the division is ignored.

The Modulus function returns the remainder of a division.

The Div function is available as of version 7.3 of the Sirius Mods.

Div syntax

  %quo = number:Div(num)

Syntax terms

A variable to receive the integer part of the quotient.
A Float value to be divided by the method argument, num.
A non-zero numeric value. A value of 0, or a value that rounds down to 0, causes a request cancellation.


The following statement returns to %z the integer quotient from the division of the number in %x (rounded) by the number in %y (rounded):

   %z = %x:div(%y)

The following statement returns '-95' to %z:

   %z = -191.4:div(2.3)

See also

List of Intrinsic Float Methods