Welcome to the Creatures Wiki! Log in and join the community.

# Difference between revisions of "DIVV"

Jump to navigation
Jump to search

m (+cat) |
m (→Example) |
||

Line 12: | Line 12: | ||

<pre> | <pre> | ||

SETV va02 va00 | SETV va02 va00 | ||

− | DIVV | + | DIVV va02 va01 |

− | MULV | + | MULV va02 va01 |

− | SUBV | + | SUBV va00 va02 |

− | |||

</pre> | </pre> | ||

## Revision as of 16:51, 18 February 2006

**DIVV** is a CAOS command for arithmetic.

## Usage

Syntax: *DIVV var (variable) x (int or float)*

Divides *var* by *x*, so `var = var / x`

.

If both *var* and *x* are integers, integer division is used. This takes the floor, so 17 / 9 = 1. If either argument is a float, floating point division is used, and *var* will be a float after the operation. If you need to perform floating point division with two integer variables, consider ITOF.

## Example

This is equivalent to *MODV va00 va01*, where va00 and va01 are both integer.

SETV va02 va00 DIVV va02 va01 MULV va02 va01 SUBV va00 va02