File : intervals-io.adb


with Reps.IO;
use Reps.IO;

package body Intervals.IO is

  procedure Show(S: in Interval; NewLine: in Boolean := True) is
  begin
    Txt_Put(Current_Output,S.C,True); --- approximate
    if S.R /= Zero then
      Put(" [");
      Txt_Put(Current_Output,S.R);    --- approximate
      Put(" ]");
    end if;
    if NewLine then New_Line; end if;
  end Show;

  procedure Get(F: in File_Type; S: out Interval; Decimal: in Boolean := True) is
  begin
    Txt_Get(F,S.C,S.R,Decimal);
  end Get;

  procedure Put(F: in File_Type; S: in Interval; Decimal: in Boolean := True) is
  begin
    if Decimal then
      Txt_Put(F,S.C,Decimal);         --- approximate
    else
      Txt_Put(F,S.C,S.R,Decimal);
    end if;
  end Put;

end Intervals.IO;