Try this that I came up with. I think it could be changed to a
NOT/AND/XOR with a little work. I don't know how fast the function
will be though.
OR(a,b)
new result set result=0
new mult set mult=1
for do quit:(a'>0)&(b'>0)
. set result=result+(((a#2)!(b#2))*mult)
. set a=a\2,b=b\2,mult=mult*2
quit result
Kevin
On 8/29/05, K.S. Bhaskar <[EMAIL PROTECTED]> wrote:
> Greg --
>
> GT.M does have some bit operations, but I have never played with them
> and I don't know if they can be applied to numerics. I would guess not,
> because GT.M actually implements multiple numeric representations under
> the covers, with automatic switching between them, in order to provide
> arithmetic with 18 significant digits. Also, the representation on disk
> is different from the representation in memory, in order to optimize
> performance.
>
> Of course, this is all transparent to the M programmer, who simply gets
> fast, seamless numerics.
>
> -- Bhaskar
>
> On Mon, 2005-08-29 at 16:10 -0500, Greg Woodhouse wrote:
> > This is something that just came up today. I know that MUMPS isn't a
> > strongly typed language, but if X and Y represent (unsigned) decimal
> > integers, does GT.M provide an easy (and efficient) means of carrying
> > out bitwise operations on X and Y). For example, if X = 12 (binary
> > 1100)and Y = 49 (binary 110001), I'd expect that
> >
> > X bitwise-or Y = 61 (binary 111101)
> >
> >
> > 1 1 0 0 0 1
> > 1 1 0 0
> > ------------
> > 1 1 1 1 0 1
> >
> >
> > ===
> > Gregory Woodhouse <[EMAIL PROTECTED]>
> >
> >
> >
> > "Perfection is achieved, not when there is nothing more
> > to add, but when there is nothing left to take away."
> > -- Antoine de Saint-Exupery
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > SF.Net email is Sponsored by the Better Software Conference & EXPO
> > September 19-22, 2005 * San Francisco, CA * Development Lifecycle
> > Practices
> > Agile & Plan-Driven Development * Managing Projects & Teams * Testing
> > & QA
> > Security * Process Improvement & Measurement *
> > http://www.sqe.com/bsce5sf
> > _______________________________________________
> > Hardhats-members mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/hardhats-members
> >
>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Hardhats-members mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/hardhats-members
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hardhats-members mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hardhats-members