Changeset 3552


Ignore:
Timestamp:
09/02/03 16:15:56 (19 years ago)
Author:
piso
Message:

MOD

Location:
trunk/j/src/org/armedbear/lisp
Files:
2 edited

Legend:

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

    r3499 r3552  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: autoloads.lisp,v 1.12 2003-08-24 19:19:01 piso Exp $
     4;;; $Id: autoloads.lisp,v 1.13 2003-09-02 16:15:56 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    7373(autoload 'make-string)
    7474(autoload 'make-pathname)
    75 (autoload '(floor ceiling round rem ftruncate ffloor fceiling fround
     75(autoload '(floor ceiling round rem mod ftruncate ffloor fceiling fround
    7676            rational rationalize)
    7777          "numbers.lisp")
  • trunk/j/src/org/armedbear/lisp/numbers.lisp

    r3525 r3552  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: numbers.lisp,v 1.7 2003-08-26 02:28:22 piso Exp $
     4;;; $Id: numbers.lisp,v 1.8 2003-09-02 16:15:20 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    8282
    8383
     84(defun mod (number divisor)
     85  "Returns second result of FLOOR."
     86  (let ((rem (rem number divisor)))
     87    (if (and (not (zerop rem))
     88       (if (minusp divisor)
     89     (plusp number)
     90     (minusp number)))
     91  (+ rem divisor)
     92  rem)))
     93
     94
    8495(defun ftruncate (number &optional (divisor 1))
    8596  (multiple-value-bind (tru rem) (truncate number divisor)
Note: See TracChangeset for help on using the changeset viewer.