Skip to content

4.8 Comparing data types and common errors

Comparing characters, strings, and floating-point types

  • The relational and equality operators work for integer, character, and floating-point built-in types.
    • Floating-point types should not be compared using the equality operators, due to the imprecise representation of floating-point numbers
  • Numbers are arithmetically compared.