Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
fpc-src / usr / share / fpcsrc / 3.2.0 / tests / webtbs / tw17685.pp
Size: Mime:
{ %opt=-Fasysutils}
{$mode iso}
{$modeswitch exceptions+}
program modulo( Output);
var
  i, j, m : integer;
begin
  i := -10;
  j := 100;

  m := i mod j;
  if m<>90 then
    halt(1);
  Writeln( ' m = (', i: 3, ') mod ', j: 3, ' = ', m: 3);


  m := -10 mod 100;
  Writeln( '-10 mod 100 = ', m :3);
  if m<>-10 then
    halt(1);

  i := 10;
  j := 100;
  m := -i mod j;
  Writeln( '-10 mod 100 = ', m :3);
  if m<>-10 then
    halt(1);


  m:=(-10) mod 100;
  Writeln( '(-10) mod 100 = ', m :3);
  if m<>90 then
    halt(1);

  m:=10 mod 100;
  Writeln( '10 mod 100 = ', m :3);
  if m<>10 then
    halt(1);

  i:=10;
  j:=-100;
  try
    m := 0;
    m := i mod j;
  except
    on e : EDivByZero do
      m:=$1234;
  end;
  if m<>$1234 then
    halt(1);

  writeln('ok');
end.