procedure rnormalize(var x: hreal);
var
  n,j: integer;
begin { rnormalize }
  with x do if (si<>0) and (ma[0]=0) then begin
    n:=0;
    repeat n:=n+1 until (ma[n]<>0) or (n=hdim);
    if ma[n]=0 then si:=0
    else begin
      ex:=ex-n;
      if ex<-exmax then underflow:=true;
      for j:=0 to hdim-n do ma[j]:=ma[j+n];
      for j:=hdim-n+1 to hdim do ma[j]:=0;
    end;
  end;
end { rnormalize };

