Changeset 3867


Ignore:
Timestamp:
09/18/03 18:24:45 (19 years ago)
Author:
piso
Message:

PHASE: handle complex numbers whose real part is zero.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/numbers.lisp

    r3711 r3867  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: numbers.lisp,v 1.14 2003-09-11 16:32:32 piso Exp $
     4;;; $Id: numbers.lisp,v 1.15 2003-09-18 18:24:45 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    233233                  0.0d0))
    234234             (complex
    235               (atan (imagpart number) (realpart number)))))
     235              (if (zerop (realpart number))
     236                  (* (/ pi 2) (signum (imagpart number)))
     237                  (atan (imagpart number) (realpart number))))))
    236238
    237239(when (and (find-package "JVM")
Note: See TracChangeset for help on using the changeset viewer.