Skip to content

Commit

Permalink
Merge pull request dylan-lang#1528 from cgay/dev
Browse files Browse the repository at this point in the history
Improve error for x ^ y where y is negative
  • Loading branch information
cgay authored Aug 3, 2023
2 parents 0c33594 + 065ea88 commit c15d4fc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sources/dylan/integer.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,8 @@ define integer-sign-adjust abs;
define method \^
(base :: <integer>, power :: <integer>) => (res :: <rational>)
if (negative?(power))
//---*** THIS IS WRONG AS / ISN'T DEFINED FOR <integer>!
//1 / (base ^ -power)
error("Negative powers are unimplemented")
error("for '%d ^ %d': negative powers are undefined for integers because division"
" is undefined for integers. Use floats instead?", base, power);
elseif (base = 2)
ash(1, power)
elseif (negative?(base))
Expand Down

0 comments on commit c15d4fc

Please sign in to comment.