isOdd

isOdd(): Boolean;

The isOdd method of the Integer primitive type returns true if the receiver represents an odd number; otherwise, it returns false.

The code fragment in the following example shows the use of the isOdd method.

if sides.isOdd then
    selectedRectangle.left := (maxWidth - defaultWidth - defaultSpacing) / 2 + 10;
    selectedRectangle.top  := (sides - 1) * (defaultHeight + defaultSpacing)
                              / 2 + 10;
else
    selectedRectangle.left := maxWidth / 2 + 10;
    selectedRectangle.top := maxHeight / 2 - defaultHeight - defaultSpacing + 10;
endif;