Remote-processing CAMBASIC Manual do Utilizador Página 112

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 208
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 111
Commands - 79
MOD
Operator
SYNTAX: n = a MOD b
PURPOSE: To return the rem ainder of an integer division.
REMARK S: a is divided by b and the remainder is placed in n.
The arguments a and b are fir st rounded to integers. T hese must be in the ra nge from 32,768 to
32,767 (no error messages are given). The division is then done and the quotient is truncated to an
integer.
The sign of the result is always the sign of a.
RELATED: “\” for integer division.
EXAMPLE: PRINT 8 MOD 4 8/4= 2 with 0 remainder 0
PRINT 5 MOD 3 5/3= 1 with 2 remainder 2
PRINT 7.5 MOD 3 7/3= 2 with 1 remainder 1
PRINT –7.5 MOD 3 8/3= 2 with 2 remainder – 2
ERROR: < Division by zero> if b is zero
Vista de página 111
1 2 ... 107 108 109 110 111 112 113 114 115 116 117 ... 207 208

Comentários a estes Manuais

Sem comentários