Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binary math operations (and, or, etc.)




On Jun 8, 2005, at 11:01, Stephen Jonke wrote:

When I try either of these scripts, the following inputs produce the "No can do!" dialog:

  andorxorit(3670288, 1048576)   -> toand should be 1048576
  andorxorit(3010440, 1048576)   -> toand should be 0

What I'm trying to do is see if a certain bit or bits is set.

Steve


Steve, you have to convert 3670288 to binary base before performing binary operations.


Look for my matematica libraries here <http://www.dicas.com/MacOs/ script_download.html>
The modulus you want is 1. It converts numbers from bases 2 through 16 to 10 and vice versa.
So you will need three scripts.
And by what I see you are doing, use Nigel's version, it will work for you, whereas mine will not.





deivy petrescu email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >Re: Binary math operations (and, or, etc.) (From: "Nigel Garvey" <email@hidden>)
 >Re: Binary math operations (and, or, etc.) (From: Stephen Jonke <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.