| 1234567891011121314151617181920212223242526 |
- program t105_lnexp;
- { t105 -- Ln and Exp on REAL. Exp scales its argument by 256 and Taylor-squares;
- Ln reduces the exponent and uses the atanh series for the mantissa. }
- var
- R : real;
- S : string[40];
- begin
- R := 0;
- Str (Exp (R) : 0 : 6, S) ; writeln (S) ;
- R := 1;
- Str (Exp (R) : 0 : 6, S) ; writeln (S) ;
- R := -1;
- Str (Exp (R) : 0 : 6, S) ; writeln (S) ;
- R := 2;
- Str (Ln (R) : 0 : 6, S) ; writeln (S) ;
- R := 1;
- Str (Ln (R) : 0 : 6, S) ; writeln (S) ;
- R := 10;
- Str (Ln (R) : 0 : 6, S) ; writeln (S) ;
- R := Exp (1);
- Str (Ln (R) : 0 : 6, S) ; writeln (S) ;
- R := Ln (2);
- Str (Exp (R) : 0 : 6, S) ; writeln (S)
- end.
|