15.1 Comparing strings as integers

Preprocessor Macro: mbfl_integer_eq (INT1, INT2)
Functionx: Function mbfl_integer_equal INT1 INT2

Return true if the arguments are equal when compared as integers; otherwise return false.

Preprocessor Macro: mbfl_integer_neq (INT1, INT2)
Function: mbfl_integer_not_equal INT1 INT2

Return true if the arguments are not equal when lexicographically compared as integers; otherwise return false.

Preprocessor Macro: mbfl_integer_lt (INT1, INT2)
Function: mbfl_integer_less INT1 INT2

Return true if INT1 is less than INT2 when compared as integers; otherwise return false.

Preprocessor Macro: mbfl_integer_gt (INT1, INT2)
Function: mbfl_integer_greater INT1 INT2

Return true if INT1 is greater than INT2 when compared as integers; otherwise return false.

Preprocessor Macro: mbfl_integer_le (INT1, INT2)
Function: mbfl_integer_less_or_equal INT1 INT2

Return true if INT1 is less than, or equal to, INT2 when compared as integers; otherwise return false.

Preprocessor Macro: mbfl_integer_ge (INT1, INT2)
Function: mbfl_integer_greater_or_equal INT1 INT2

Return true if INT1 is greater than, or equal to, INT2 when compared as integers; otherwise return false.

Function: mbfl_integer_compare INT1 INT2

Compare INT1 and INT2:

  • if INT1 = INT2 return 0;
  • if INT1 < INT2 return 1;
  • if INT1 > INT2 return 2.

This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.