Last change
on this file since 8991 was
8991,
checked in by gz, 12 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size:
527 bytes

Line  

1  ;* Mode: Lisp * 

2  ;;;; Author: Paul Dietz 

3  ;;;; Created: Mon Sep 1 21:30:38 2003 

4  ;;;; Contains: Aux. functions for testing EXP, EXPT 

5  

6  (inpackage :cltest) 

7  

8  (defun myexp (x n) 

9  "Compute e^x in the appropriate float result type, summing 

10  the first n terms of the Taylor series." 

11  (assert (realp x)) 

12  (let ((result 1) 

13  (xrat (rational x))) 

14  (loop 

15  for i from (1 n) downto 1 

16  do (setq result (+ 1 (/ (* xrat result) i)))) 

17  (if (floatp x) 

18  (float result x) 

19  (float result 1.0f0)))) 

20  

21  

22  

23  

24  

Note: See
TracBrowser
for help on using the repository browser.