Compare Integer table



Compare Integer table
Smart pascal source code
var i, j: Integer; var ih, jh: Integer; begin for i := -1 to 1 do begin for j := -1 to 1 do begin WriteLn('**** ' + IntToStr(i) + ', ' + IntToStr(j) + ' : '); if i = j then WriteLn('=,'); if i <> j then WriteLn('<>,'); if i < j then WriteLn('<,'); if i <= j then WriteLn('<=,'); if i > j then WriteLn('>,'); if i >= j then WriteLn('>=,'); WriteLn(''); end; end; for i := -1 to 1 do begin for j := -1 to 1 do begin ih := i * (1 shl 32); jh := j * (1 shl 32); WriteLn('**** ' + IntToStr(ih) + ', ' + IntToStr(jh) + ' : '); if ih = jh then WriteLn('=,'); if ih <> jh then WriteLn('<>,'); if ih < jh then WriteLn('<,'); if ih <= jh then WriteLn('<=,'); if ih > jh then WriteLn('>,'); if ih >= jh then WriteLn('>=,'); WriteLn(''); end; end; for i := -1 to 1 do begin for j := -1 to 1 do begin ih := i + (1 shl 32); jh := j + (1 shl 32); WriteLn('**** ' + IntToStr(ih) + ', ' + IntToStr(jh) + ' : '); if ih = jh then WriteLn('=,'); if ih <> jh then WriteLn('<>,'); if ih < jh then WriteLn('<,'); if ih <= jh then WriteLn('<=,'); if ih > jh then WriteLn('>,'); if ih >= jh then WriteLn('>=,'); WriteLn(''); end; end; for i := -1 to 1 do begin for j := -1 to 1 do begin ih := i - (1 shl 32); jh := j - (1 shl 32); WriteLn('**** ' + IntToStr(ih) + ', ' + IntToStr(jh) + ' : '); if ih = jh then WriteLn('=,'); if ih <> jh then WriteLn('<>,'); if ih < jh then WriteLn('<,'); if ih <= jh then WriteLn('<=,'); if ih > jh then WriteLn('>,'); if ih >= jh then WriteLn('>=,'); WriteLn(''); end; end; { <<< CONSOLE OUTPUTS >>> **** -1, -1 : =, <=, >=, **** -1, 0 : <>, <, <=, **** -1, 1 : <>, <, <=, **** 0, -1 : <>, >, >=, **** 0, 0 : =, <=, >=, **** 0, 1 : <>, <, <=, **** 1, -1 : <>, >, >=, **** 1, 0 : <>, >, >=, **** 1, 1 : =, <=, >=, **** -4294967296, -4294967296 : =, <=, >=, **** -4294967296, 0 : <>, <, <=, **** -4294967296, 4294967296 : <>, <, <=, **** 0, -4294967296 : <>, >, >=, **** 0, 0 : =, <=, >=, **** 0, 4294967296 : <>, <, <=, **** 4294967296, -4294967296 : <>, >, >=, **** 4294967296, 0 : <>, >, >=, **** 4294967296, 4294967296 : =, <=, >=, **** 0, 0 : =, <=, >=, **** 0, 1 : <>, <, <=, **** 0, 2 : <>, <, <=, **** 1, 0 : <>, >, >=, **** 1, 1 : =, <=, >=, **** 1, 2 : <>, <, <=, **** 2, 0 : <>, >, >=, **** 2, 1 : <>, >, >=, **** 2, 2 : =, <=, >=, **** -2, -2 : =, <=, >=, **** -2, -1 : <>, <, <=, **** -2, 0 : <>, <, <=, **** -1, -2 : <>, >, >=, **** -1, -1 : =, <=, >=, **** -1, 0 : <>, <, <=, **** 0, -2 : <>, >, >=, **** 0, -1 : <>, >, >=, **** 0, 0 : =, <=, >=, }