/[cmucl]/src/clx/dependent.lisp
ViewVC logotype

Diff of /src/clx/dependent.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2.1.10 by ram, Mon May 25 21:39:40 1992 UTC revision 1.2.1.11 by ram, Mon Jun 8 14:02:16 1992 UTC
# Line 2072  Line 2072 
2072             :expected-type type             :expected-type type
2073             :type-string error-string))             :type-string error-string))
2074    
2075    #+cmu (progn
2076    
2077    ;;; This overrides the (probably incorrect) definition in clx.lisp.  Since PI
2078    ;;; is irrational, there can't be a precise rational representation.  In
2079    ;;; particular, the different float approximations will always be /=.  This
2080    ;;; causes problems with type checking, because people might compute an
2081    ;;; argument in any precision.
2082    ;;;
2083    (deftype angle () '(satisfies anglep))
2084    
2085    (defun anglep (x)
2086      (typecase x
2087        (fixnum
2088         (<= (truncate (* pi -2)) x (truncate (* pi 2))))
2089        (single-float
2090         (<= (coerce (* pi -2) 'single-float) x (coerce (* pi 2) 'single-float)))
2091        (double-float
2092         (<= (* pi -2) x (* pi 2)))
2093        (t nil)))
2094    
2095    )
2096    
2097    
2098  ;;-----------------------------------------------------------------------------  ;;-----------------------------------------------------------------------------
2099  ;; Error handlers  ;; Error handlers

Legend:
Removed from v.1.2.1.10  
changed lines
  Added in v.1.2.1.11

  ViewVC Help
Powered by ViewVC 1.1.5