• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Binary math operations (and, or, etc.)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: Re: Binary math operations (and, or, etc.)
  • From: deivy petrescu <email@hidden>
  • Date: Wed, 8 Jun 2005 15:12:53 -0400


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: This email sent to email@hidden
  • Follow-Ups:
    • Re: Binary math operations (and, or, etc.)
      • From: Stephen Jonke <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>)

  • Prev by Date: Re: Search & Replace multiple Paragraph returns
  • Next by Date: Search & Replace multiple Paragraph returns
  • Previous by thread: Re: Binary math operations (and, or, etc.)
  • Next by thread: Re: Binary math operations (and, or, etc.)
  • Index(es):
    • Date
    • Thread