summaryrefslogtreecommitdiff
path: root/lisp/calc/calc-arith.el
diff options
context:
space:
mode:
authorColin Walters <walters@gnu.org>2001-11-19 07:44:56 +0000
committerColin Walters <walters@gnu.org>2001-11-19 07:44:56 +0000
commit3132f345bc1ab68e4425178266e3d4ad1b2ccd02 (patch)
tree43339ccf578fb555b44dd0c84aa0e7b0389dc8b0 /lisp/calc/calc-arith.el
parentf269b73e3ea3de8c539d544fd0310b63fc029f20 (diff)
Change all toplevel `setq' forms to `defvar' forms, and move them
before their first use. Use `when', `unless'. Remove trailing periods from error forms. Add description and headers suggested by Emacs Lisp coding conventions.
Diffstat (limited to 'lisp/calc/calc-arith.el')
-rw-r--r--lisp/calc/calc-arith.el22
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/calc/calc-arith.el b/lisp/calc/calc-arith.el
index d510c48436..95b60bc052 100644
--- a/lisp/calc/calc-arith.el
+++ b/lisp/calc/calc-arith.el
@@ -1,6 +1,9 @@
-;; Calculator for GNU Emacs, part II [calc-arith.el]
+;;; calc-arith.el --- arithmetic functions for Calc
+
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
-;; Written by Dave Gillespie, daveg@synaptics.com.
+
+;; Author: David Gillespie <daveg@synaptics.com>
+;; Maintainer: Colin Walters <walters@debian.org>
;; This file is part of GNU Emacs.
@@ -19,7 +22,9 @@
;; file named COPYING. Among other things, the copyright notice
;; and this notice must be preserved on all copies.
+;;; Commentary:
+;;; Code:
;; This file is autoloaded from calc-ext.el.
(require 'calc-ext)
@@ -148,9 +153,9 @@
;;;; Declarations.
-(setq math-decls-cache-tag nil)
-(setq math-decls-cache nil)
-(setq math-decls-all nil)
+(defvar math-decls-cache-tag nil)
+(defvar math-decls-cache nil)
+(defvar math-decls-all nil)
;;; Math-decls-cache is an a-list where each entry is a list of the form:
;;; (VAR TYPES RANGE)
@@ -880,7 +885,7 @@
;;;; Arithmetic.
-(defun calcFunc-neg (a)
+(defsubst calcFunc-neg (a)
(math-normalize (list 'neg a)))
(defun math-neg-fancy (a)
@@ -2351,7 +2356,7 @@
a
(math-float (math-ceiling a prec))))
-(setq math-rounding-mode nil)
+(defvar math-rounding-mode nil)
;;; Coerce A to be an integer (by rounding to nearest integer). [I N] [Public]
(defun math-round (a &optional prec)
@@ -2620,6 +2625,8 @@
(math-normalize (list '+ a b))
(math-add a b)))
+(defvar math-combine-prod-e '(var e var-e))
+
;;; The following is expanded out four ways for speed.
(defun math-combine-prod (a b inva invb scalar-okay)
(cond
@@ -2734,7 +2741,6 @@
(condition-case err
(math-pow a apow)
(inexact-result (list '^ a apow)))))))))))
-(setq math-combine-prod-e '(var e var-e))
(defun math-mul-or-div (a b ainv binv)
(if (or (Math-vectorp a) (Math-vectorp b))