Contents | Prev | Next

8.2.2.7 Real division (/)

Description

When the / operator has two operands of integral type or real type it performs real division and the result is a value of real type. Any operands of integral type are converted into operands of real type before the division is performed.

Example

Here are some examples using the / operator to perform division:

   5 / 2          which results in the real value 2.5
   5.0 / 2.0      which results in the real value 2.5
   -5 / 2         which results in the real value -2.5
   5.0 / -2.0     which results in the real value -2.5
   -5.0 / -2.0    which results in the real value 2.5

Contents | Prev | Next