;;; calc-arith.el --- arithmetic functions for Calc
;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004,
-;; 2005 Free Software Foundation, Inc.
+;; 2005, 2006 Free Software Foundation, Inc.
;; Author: David Gillespie <daveg@synaptics.com>
;; Maintainer: Jay Belanger <belanger@truman.edu>
(and (math-known-scalarp b)
(math-add (nth 1 a) b))))
(and (eq (car-safe b) 'calcFunc-idn)
- (= (length a) 2)
+ (= (length b) 2)
(or (and (math-square-matrixp a)
(math-add a (math-mimic-ident (nth 1 b) a)))
(and (math-known-scalarp a)
;;; Division from the left.
(defun calcFunc-ldiv (a b)
- (math-mul (math-pow a -1) b))
-
+ (if (math-known-scalarp a)
+ (math-div b a)
+ (math-mul (math-pow a -1) b)))
(defun calcFunc-mod (a b)
(math-normalize (list '% a b)))