Abl-electronic PIC Microcontrollers PIC16 Bedienungsanleitung Seite 112

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 312
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 111
Relational Operators
Use relational operators to test equality or inequality of expressions. If the expres-
sion evaluates to true, it returns 1; otherwise it returns 0.
All relational operators associate from left to right.
Relational Operators Overview
Relational Operators in Expressions
Precedence of arithmetic and relational operators was designated in such a way to
allow complex expressions without parentheses to have expected meaning:
a + 5 >= c - 1.0 / e
// i.e. (a + 5) >= (c - (1.0 / e))
Always bear in mind that relational operators return either 0 or 1. Consider the fol-
lowing examples:
8 == 13 > 5
// returns 0: 8==(13>5), 8==1, 0
14 > 5 < 3
// returns 1: (14>5)<3, 1<3, 1
a < b < 5
// returns 1: (a<b)<5, (0 or 1)<5, 1
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
104
MikroElektronika:
Development
tools
-
Books
-
Compilers
page
Operator Operation Precedence
==
equal 9
!=
not equal 9
>
greater than 10
<
less than 10
>=
greater than or equal 10
<=
less than or equal 10
Seitenansicht 111
1 2 ... 107 108 109 110 111 112 113 114 115 116 117 ... 311 312

Kommentare zu diesen Handbüchern

Keine Kommentare