 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>>>> Binary shifts are multiplication and division as well. :P
>>> What you want is binary rotations. ;-)
>> That depends on whether the bits actually get rotated. From my
>> recollection of x86 assembly, it's a shift, not a rotation. :)
>>
>> Jim
>
> My recollection, of course, has changed now that I re-read this, I
> remember ROR and ROL operators, which do in fact rotate. I just remember
> using SHL and SHR more frequently.
Whether your processor supports it or not, binary rotations exist. You
can implement them the hard way if you must. I've seen a few block
ciphers that use 'em too...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 24/08/2010 7:33 PM, Darren New wrote:
> Stephen wrote:
>> Here's a clue
>> http://tinyurl.com/6zz4l7
>
> Oh, it downloaded a MP3. OK. Nevermind. Very cute.
>
Cute, that's me :-)
--
Best Regards,
Stephen
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Darren New <dne### [at] san rr com> wrote:
> andrel wrote:
> > That is why they are so much cheaper than real multiplicatons and
> > division.
> If you're using a compiler where a shift by a constant is cheaper than a
> division by a constant, you're in trouble.
He was talking about hardware, not about compilers.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> Darren New <dne### [at] san rr com> wrote:
>> andrel wrote:
>>> That is why they are so much cheaper than real multiplicatons and
>>> division.
>
>> If you're using a compiler where a shift by a constant is cheaper than a
>> division by a constant, you're in trouble.
>
> He was talking about hardware, not about compilers.
Yes, I knew that. :-)
--
Darren New, San Diego CA, USA (PST)
Quoth the raven:
Need S'Mores!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 24-8-2010 21:34, Jim Henderson wrote:
> On Tue, 24 Aug 2010 21:21:53 +0200, andrel wrote:
>
>> On 24-8-2010 18:11, Jim Henderson wrote:
>>> On Tue, 24 Aug 2010 08:41:13 -0500, Mike Raiford wrote:
>>>
>>>> On 8/23/2010 10:53 PM, Jim Henderson wrote:
>>>>> "Shifting the decimal point" isn't a recognised mathematical
>>>>> operation, well, it wasn't when I took maths. Multiplication and
>>>>> division are. Just because one takes a shortcut doesn't mean it's a
>>>>> different operation.
>>>> Shifts are perfectly legitimate mathematical operations. Many of the
>>>> things computers do couldn't be done easily without a shift operation
>>>> :P
>>> Binary shifts are multiplication and division as well. :P
>> yes and no. Conceptually yes, in a hardware implementation on a chip no.
>> That is why they are so much cheaper than real multiplicatons and
>> division. The same goes for wetware.
>
> That still doesn't mean it isn't mathematically a multipilcation or
> division - the operation doesn't change just because you took a
> shortcut. ;-)
that is what I said, or at least tried to.
>> But I appreciate your stubbornness.
>
> I figured you - of all people - would. ;-)
we aim to please
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 25-8-2010 17:28, Darren New wrote:
> Warp wrote:
>> Darren New <dne### [at] san rr com> wrote:
>>> andrel wrote:
>>>> That is why they are so much cheaper than real multiplicatons and
>>>> division.
>>
>>> If you're using a compiler where a shift by a constant is cheaper
>>> than a division by a constant, you're in trouble.
>>
>> He was talking about hardware, not about compilers.
>
> Yes, I knew that. :-)
>
Even so I do not understand the remark. Do you mean that a compiler
should not be aware what is cheaper (in time) to do the same thing? Or
that that is not the case anymore, in which case I beg to differ.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Wed, 25 Aug 2010 10:28:25 +0100, Orchid XP v8 wrote:
>>>>> Binary shifts are multiplication and division as well. :P
>>>> What you want is binary rotations. ;-)
>>> That depends on whether the bits actually get rotated. From my
>>> recollection of x86 assembly, it's a shift, not a rotation. :)
>>>
>>> Jim
>>
>> My recollection, of course, has changed now that I re-read this, I
>> remember ROR and ROL operators, which do in fact rotate. I just
>> remember using SHL and SHR more frequently.
>
> Whether your processor supports it or not, binary rotations exist. You
> can implement them the hard way if you must. I've seen a few block
> ciphers that use 'em too...
Well, that's why I said what I said about my faulty recollection. ;-)
Jim
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 8/23/2010 2:47 PM, Darren New wrote:
> Metric has the advantage that you don't get into weird problems with
> units when you do science. I don't think it really matters that things
> are specifically multiples of 10 until you start getting into figuring
> out ranges of numbers where exponents come into play.
If you've taken physics, the real help comes in the fact that the
majority of units are some multiple of other units with no other factors
to throw in (and thus, misremembered at times).
For example, one Watt (unit of power) is equal to one Joule (unit of
energy) per second. One horsepower (imperial unit of power) is equal to
some silly number of foot-pounds per second.
Regards,
John
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
John VanSickle wrote:
> For example, one Watt (unit of power) is equal to one Joule (unit of
> energy) per second. One horsepower (imperial unit of power) is equal to
> some silly number of foot-pounds per second.
Sure. That comes from having only one unit of measurement for each
fundamental thing you're measuring. On the other hand, you still get some
arbitrary factors in there, like moles or parsecs.
If I asked you how much power it took to lift what a horse could, or how
many pounds of force you had to push a foot-long lever with, you'd once
again have those arbitrary scale factors thrown in. ;-)
I'm not saying metric isn't easier. I'm pointing out that imperial stuff,
since it's based on people, is very poor at measuring things that aren't
approximately relevant to people, like the weight of planets or the size of
atoms.
--
Darren New, San Diego CA, USA (PST)
Quoth the raven:
Need S'Mores!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Darren New <dne### [at] san rr com> wrote:
> I'm not saying metric isn't easier. I'm pointing out that imperial stuff,
> since it's based on people, is very poor at measuring things that aren't
> approximately relevant to people, like the weight of planets or the size of
> atoms.
It's not just that: imperial isn't precise. I asked before and it was ignored,
but should I measure 10 foot to be the distance traveled by my 10 of my steps or
10 of my daughter steps?
Besides, you need to put true mental calculations at work to convert between
units, instead of simply moving the point forward or backwards between
centimeters, meters and kilometers...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |