axiom-developer
[Top][All Lists]
Advanced

[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 21:30:40 -0400
User-agent: Mutt/1.5.4i

On Tue, Oct 14, 2003 at 09:09:50PM -0400, Page, Bill wrote:
> Does
> 
>   shift(x,y) == -integer(ASH(-x,y)$Lisp
> 
> involve two (potential long) integer multiplications?
> I.e. -1*integer(ASH(-1*x,y)$Lisp

I don't know whether adding/subtracting 1 or negation will be faster,
but either one should be faster than any multiplication (unless
multiplication by -1 is special cased somewhere).  There are no carries
to worry about.

I suspect the additions are probably faster, actually.

Peace,
        Dylan

Attachment: signature.asc
Description: Digital signature


reply via email to

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