# Difference between revisions of "Div (Float function)"

Jump to navigation
Jump to search

m (1 revision) |
m (1 revision) |
||

Line 14: | Line 14: | ||

===Syntax terms=== | ===Syntax terms=== | ||

<table class="syntaxTable"> | <table class="syntaxTable"> | ||

− | <tr><th>%quo </th> | + | <tr><th>%quo</th> |

<td>A variable to receive the integer part of the quotient. </td></tr> | <td>A variable to receive the integer part of the quotient. </td></tr> | ||

− | <tr><th>number </th> | + | <tr><th>number</th> |

<td>A Float value to be divided by the method argument, ''num''. </td></tr> | <td>A Float value to be divided by the method argument, ''num''. </td></tr> | ||

− | <tr><th>num </th> | + | <tr><th>num</th> |

<td>A non-zero numeric value. A value of 0, or a value that rounds down to 0, causes a request cancellation.</td></tr> | <td>A non-zero numeric value. A value of 0, or a value that rounds down to 0, causes a request cancellation.</td></tr> | ||

</table> | </table> |

## Revision as of 15:49, 19 January 2011

Integer division (Float class)

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

## Syntax

%number = float:Div( divisor)

### Syntax terms

%quo | A variable to receive the integer part of the quotient. |
---|---|

number | A Float value to be divided by the method argument, num. |

num | A non-zero numeric value. A value of 0, or a value that rounds down to 0, causes a request cancellation. |

## Examples

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