/

Syntax expression1 / expression2

Action The arithmetic division operator yields the result of dividing the value of expression1 by the value of expression2.

Examples 10 / 3

   » 3

The result of integer division is truncated.

10 / 3.0

   » 3.3333

The number 10 is "promoted" to a double, the type of 3.0, in order to perform the division.

long (clock.now () / 3600)

   » 770199

This expression yields the number of hours that have passed since midnight, Jan 1, 1904.

Notes UserTalk employs automatic type coercion when evaluating arithmetic and comparative operations; the two expressions or the division operation need not be of the same type. Generally, the resulting type is the more complex type, the one that can most

readily represent both values.

Only numeric-compatible types - short, long, single, double, date, etc. - can be divided by one another.

See Also +

-

*

%

Discuss

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.