Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
cmucl
cmucl
Commits
20ee8ef2
Commit
20ee8ef2
authored
Nov 07, 2013
by
Raymond Toy
Browse files
Add shortcut for (expt -1 power).
parent
373bc974
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/code/irrat.lisp
View file @
20ee8ef2
...
...
@@ -318,11 +318,13 @@
;;; of power are calculated as positive integers, and inverted if negative.
;;;
(
defun
intexp
(
base
power
)
;; Handle the special case of 1^power
. Maxima sometimes does this,
;; and there's no need to cause a continuable
error in this case.
;;
Should we also handle (-1)^power?
;; Handle the special case of 1^power
and (-1)^power. Maxima
;;
sometimes does this,
and there's no need to cause a continuable
;;
error in this case.
(
when
(
eql
base
1
)
(
return-from
intexp
base
))
(
when
(
eql
base
-1
)
(
return-from
intexp
(
if
(
oddp
power
)
-1
1
)))
(
when
(
>
(
abs
power
)
*intexp-maximum-exponent*
)
;; Allow user the option to continue with calculation, possibly
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment