t105_lnexp.pas 652 B

1234567891011121314151617181920212223242526
  1. program t105_lnexp;
  2. { t105 -- Ln and Exp on REAL. Exp scales its argument by 256 and Taylor-squares;
  3. Ln reduces the exponent and uses the atanh series for the mantissa. }
  4. var
  5. R : real;
  6. S : string[40];
  7. begin
  8. R := 0;
  9. Str (Exp (R) : 0 : 6, S) ; writeln (S) ;
  10. R := 1;
  11. Str (Exp (R) : 0 : 6, S) ; writeln (S) ;
  12. R := -1;
  13. Str (Exp (R) : 0 : 6, S) ; writeln (S) ;
  14. R := 2;
  15. Str (Ln (R) : 0 : 6, S) ; writeln (S) ;
  16. R := 1;
  17. Str (Ln (R) : 0 : 6, S) ; writeln (S) ;
  18. R := 10;
  19. Str (Ln (R) : 0 : 6, S) ; writeln (S) ;
  20. R := Exp (1);
  21. Str (Ln (R) : 0 : 6, S) ; writeln (S) ;
  22. R := Ln (2);
  23. Str (Exp (R) : 0 : 6, S) ; writeln (S)
  24. end.