Commit de0f3672 authored by rtoy's avatar rtoy
Browse files

f2cl0.l:

o Export new dfloat function, an alias for dble.
o Merge some cleanups from Maxima.

f2cl1.l:
o Add dfloat to list of intrinsic functions.

macros.l:
o Merge some cleanups and fixes from Maxima.  Mostly for gcl and ecl.
o Add implementation of dfloat.
parent 5ec33184
......@@ -57,7 +57,7 @@
#:amin1 #:amod #:anint #:asin #:atan #:atan2
#:cabs #:cexp #:fchar #:clog #:cmplx #:dcmplx #:conjg #:ccos
#:csin #:csqrt #:zsqrt #:dabs #:dacos #:dasin
#:datan #:datan2 #:dble #:dcos #:dcosh #:dexp #:dim
#:datan #:datan2 #:dble #:dcos #:dcosh #:dexp #:dfloat #:dim
#:dint #:dlog #:dlog10 #:dmax1 #:dmin1 #:dmod
#:dnint #:dprod #:dsign #:dsin #:dsinh #:dsqrt #:dtan
#:dtanh #:ffloat #:iabs #:ichar #:idim #:idint
......@@ -71,11 +71,11 @@
))
(defpackage :fortran-to-lisp
(:use :cl)
(:documentation "the package holding all symbols need by the fortran to lisp converter")
(:use :cl)
(:documentation "The package holding all symbols need by the Fortran to Lisp converter")
(:nicknames :f2cl)
(:export
;; main routines
;; Main routines
#:f2cl
#:f2cl-compile
#:f2cl-version
......@@ -84,8 +84,20 @@
;;;-------------------------------------------------------------------------
;;; end of f2cl0.l
;;;
;;; $Id: f2cl0.l,v 265b8be95c73 2008/02/22 22:13:18 rtoy $
;;; $Id: f2cl0.l,v 17bf313877f7 2009/01/07 17:28:19 rtoy $
;;; $Log$
;;; Revision 1.22 2009/01/07 17:28:19 rtoy
;;; f2cl0.l:
;;; o Export new dfloat function, an alias for dble.
;;; o Merge some cleanups from Maxima.
;;;
;;; f2cl1.l:
;;; o Add dfloat to list of intrinsic functions.
;;;
;;; macros.l:
;;; o Merge some cleanups and fixes from Maxima. Mostly for gcl and ecl.
;;; o Add implementation of dfloat.
;;;
;;; Revision 1.21 2008/02/22 22:13:18 rtoy
;;; o Add function F2CL-VERSION to get version info.
;;; o Add version string to each of the files so F2CL-VERSION can get the
......
......@@ -17,7 +17,7 @@
"Use (f2cl-version) instead")
(defparameter *f2cl1-version*
"$Id: f2cl1.l,v a4d404fc248b 2009/01/03 00:48:57 rtoy $")
"$Id: f2cl1.l,v 17bf313877f7 2009/01/07 17:28:19 rtoy $")
;; Forward declarations.
(defvar *f2cl2-version*)
......@@ -47,6 +47,7 @@
sinh dsinh cosh dcosh tanh dtanh
zsqrt
cdabs dconjg
dfloat
)
"A list of all the intrinsic functions in Fortran 77")
......@@ -3175,8 +3176,20 @@ loop2
;;;-----------------------------------------------------------------------------
;;; end of f2cl1.l
;;;
;;; $Id: f2cl1.l,v a4d404fc248b 2009/01/03 00:48:57 rtoy $
;;; $Id: f2cl1.l,v 17bf313877f7 2009/01/07 17:28:19 rtoy $
;;; $Log$
;;; Revision 1.211 2009/01/07 17:28:19 rtoy
;;; f2cl0.l:
;;; o Export new dfloat function, an alias for dble.
;;; o Merge some cleanups from Maxima.
;;;
;;; f2cl1.l:
;;; o Add dfloat to list of intrinsic functions.
;;;
;;; macros.l:
;;; o Merge some cleanups and fixes from Maxima. Mostly for gcl and ecl.
;;; o Add implementation of dfloat.
;;;
;;; Revision 1.210 2009/01/03 00:48:57 rtoy
;;; PARSE-IMPLICIT-DECL was not correctly handling
;;;
......
......@@ -6,7 +6,7 @@
(in-package :f2cl-lib)
(defparameter *f2cl-macros-version*
"$Id: macros.l,v 256d9c08837b 2009/01/07 02:22:00 rtoy $")
"$Id: macros.l,v 17bf313877f7 2009/01/07 17:28:19 rtoy $")
;; macros:
;; rexpt
......@@ -39,7 +39,10 @@
;; constant-list
;;----------------------------------------------------------------------------
(eval-when (compile load eval) (proclaim '(special *verbose*)))
(eval-when
#+gcl (compile load eval)
#-gcl (:compile-toplevel :load-toplevel :execute)
(proclaim '(special *verbose*)))
;;----------------------------------------------------------------------------
#+aclpc (defmacro rexpt (x y) `(realpart (expt ,x ,y)))
#-aclpc (defmacro rexpt (x y) `(expt ,x ,y))
......@@ -63,11 +66,12 @@ is not included")
;; If you change this, you may need to change some of the macros
;; below, such as INT and AINT!
#+(or cmu scl)
#+(or cmu scl sbcl)
(deftype integer4 (&optional (low #x-80000000) (high #x7fffffff))
`(integer ,low ,high))
#-(or cmu scl)
(deftype integer4 (&rest p)
#-(or cmu scl sbcl)
(deftype integer4 (&optional low high)
(declare (ignore low high))
'fixnum)
(deftype integer2 ()
......@@ -628,7 +632,7 @@ is not included")
;; also return the real part of a complex number. CMPLX takes one or
;; two args and creates a complex number.
(declaim (inline freal sngl dble cmplx))
(declaim (inline freal sngl dble dfloat cmplx))
(defun freal (x)
(coerce (realpart x) 'single-float))
......@@ -638,6 +642,9 @@ is not included")
(defun dble (x)
(coerce (realpart x) 'double-float))
(defun dfloat (x)
(coerce (realpart x) 'double-float))
(defun cmplx (x &optional y)
(complex x (if y y 0)))
......@@ -1495,27 +1502,20 @@ causing all pending operations to be flushed"
;; D1MACH( 5) = LOG10(B)
;;
#+gcl
(defconstant least-positive-normalized-double-float least-positive-double-float)
#+gcl
(defconstant least-positive-normalized-single-float least-positive-single-float)
(defun d1mach (i)
(ecase i
(1
#-gcl least-positive-normalized-double-float
#+gcl least-positive-double-float)
(1 least-positive-normalized-double-float)
(2 most-positive-double-float)
(3 double-float-epsilon)
(4 (scale-float double-float-epsilon 1))
(3 #-(or gcl ecl) double-float-epsilon
#+(or gcl ecl) (scale-float (float #X10000000000001 1d0) -105))
(4 (scale-float #-(or gcl ecl) double-float-epsilon
#+(or gcl ecl) (scale-float (float #X10000000000001 1d0) -105)
1))
(5 (log (float (float-radix 1d0) 1d0) 10d0))))
(defun r1mach (i)
(ecase i
(1
#-gcl least-positive-normalized-single-float
#+gcl least-positive-single-float)
(1 least-positive-normalized-single-float)
(2 most-positive-single-float)
(3 single-float-epsilon)
(4 (scale-float single-float-epsilon 1))
......@@ -1637,8 +1637,20 @@ causing all pending operations to be flushed"
;;;-------------------------------------------------------------------------
;;; end of macros.l
;;;
;;; $Id: macros.l,v 256d9c08837b 2009/01/07 02:22:00 rtoy $
;;; $Id: macros.l,v 17bf313877f7 2009/01/07 17:28:19 rtoy $
;;; $Log$
;;; Revision 1.108 2009/01/07 17:28:19 rtoy
;;; f2cl0.l:
;;; o Export new dfloat function, an alias for dble.
;;; o Merge some cleanups from Maxima.
;;;
;;; f2cl1.l:
;;; o Add dfloat to list of intrinsic functions.
;;;
;;; macros.l:
;;; o Merge some cleanups and fixes from Maxima. Mostly for gcl and ecl.
;;; o Add implementation of dfloat.
;;;
;;; Revision 1.107 2009/01/07 02:22:00 rtoy
;;; Need to quit a repeated group if we're out of arguments to print.
;;; This prevents us from repeatedly print newlines and other strings when
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment