[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Left shifts of negative numbers

From: Dylan Thurston
Subject: Re: [Axiom-developer] Left shifts of negative numbers
Date: Tue, 14 Oct 2003 22:48:28 -0400
User-agent: Mutt/1.5.4i

On Tue, Oct 14, 2003 at 07:06:07PM -0400, Page, Bill wrote:
> [ Some of your emails arrive as text file attachments to
> otherwise empty emails (such as this one) and other times
> as ordinary email? Are you sending an unusual format to
> the axioim mailing list? (e.g. HTML or "rich text" format). ]

It's because I habitually sign my e-mails, and that's how the mailing
list software deals with it.  I'll stop if it's too annoying.

> ... Oddly, I could not find any definition for

It's defined as a macro equivalent to ash for fixnum's in

> Failing finding a native Lisp function that does the
> job, how about defining it as
>   shift(x,y) == integer(ASH(x-1,y)$Lisp)+1

In the case when x and y are both negative, I think this gives the
"round towards zero" semantics that seem to be expected.  An
alternative is

  shift(x,y) == -integer(ASH(-x,y)$LISP)

which might be clearer.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]