National-instruments AutoCode NI MATRIX Uživatelský manuál Strana 56

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 250
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 55
Chapter 2 C Language Reference
© National Instruments Corporation 2-39 AutoCode Reference
Table 2-7 shows permissible operand and result sizes for the arithmetic
macros.
For example, the macro to add two 8-bit unsigned numbers with overflow
protection and produce an unsigned 8-bit result is:
ubADD_ub_ubp(n1,n2,rp1,rp2,rp3)
The macro to subtract a 16-bit unsigned number from a 16-bit signed
number with overflow protection and produce an unsigned 16-bit result is:
usSUB_ss_usp(n1,n2,rp1,rp2,rp3)
The macro to multiply two 16-bit signed numbers with overflow protection
and produce a 16-bit signed result is:
ssMUL_ss_ssp(n1,n2,rp1,rp2,rp3)
The macro to divide two 32-bit signed numbers with overflow protection
and produce a 32-bit signed result is:
slDIV_sl_slp(n1,n2,rp1,rp2,rp3)
Table 2-7. Arithmetic Macros—Operand and Result Sizes
Operation Operand 1 Size Operand 2 Size Result Size
addition
subtraction
multiplication
byte byte byte or short
short short short or long
long long long
division
(operand 1 is the
dividend; operand 2
is the divisor)
byte byte byte
short byte byte
short short short
long short short
long long long
Zobrazit stránku 55
1 2 ... 51 52 53 54 55 56 57 58 59 60 61 ... 249 250

Komentáře k této Příručce

Žádné komentáře