Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: XOR Functions...

Re: XOR Functions...

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Mon, 27 Sep 1999 19:14:28 +0100
Message-ID: <938456502.17396.0.nnrp-11.9e984b29@news.demon.co.uk>

You could have a look at the utl_raw package, alternatively you could fiddle about with the BITAND function - which takes two numbers up to 2^32 -1 (I think) and ANDs them.

A XOR B is then:

   ( A OR B) AND (NOT A and NOT B)
which is

    NOT(NOT A and NOT B) AND (NOT A and NOT B)

where NOT X is (2^32 -1) - X

It's going to end up looking a bit messy though.

--

Jonathan Lewis
Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk

Antony Giblin wrote in message
<938449026.16137.1.nnrp-10.c2de09a4_at_news.demon.co.uk>...
>Does anyone know how I can XOR two Integers and return an integer,
>i.e. (INTa XOR INTb) = INTc
>Thanks,
>Tony Giblin.
>
>
Received on Mon Sep 27 1999 - 13:14:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US