1. Re: Encrypting (and bit-shifting)
- Posted by John D Kinne <JDKINNE at MIAMIU.MUOHIO.EDU> Jul 11, 1997
- 589 views
I am fascinated by this discussion. Does it make a difference whether Euphoria actually shifts bits, integer divides or float divides? I would have estimated that there would be more overhead in analyzing the operands than just going ahead and doing the divide. Especially if the divisor is not a constant. John Kinne At 07:00 PM 7/10/97 UT, you wrote: >---------------------- Information from the mail header ----------------------- >Sender: Euphoria Programming for MS-DOS <EUPHORIA at MIAMIU.ACS.MUOHIO.EDU> >Poster: Robert Craig <rds at MSN.COM> >Subject: Re: Encrypting (and bit-shifting) >--------------------------------------------------------------------------- ---- > >Pete Eberlein asks: >> What about dividing by constant powers of 2? Is this done using a >> number of shift right's? > >Only integer divide by 2 is optimized to a shift-right. >But at least when you say x = floor(y/n) >where y and n are integers, >it will optimize it to an integer divide, rather than >using a floating-point divide plus an explicit floor operation. > >Regards, > Rob Craig > Rapid Deployment Software >