From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id AAA27826; Sat, 22 Feb 2003 00:02:39 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA27589 for ; Sat, 22 Feb 2003 00:02:38 +0100 (MET) Received: from epexch01.qlogic.org ([63.170.40.3]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h1LN2bH10496 for ; Sat, 22 Feb 2003 00:02:37 +0100 (MET) Received: from epmailtmp.qlogic.org ([10.20.33.254]) by epexch01.qlogic.org with Microsoft SMTPSVC(5.0.2195.5329); Fri, 21 Feb 2003 17:01:14 -0600 Received: from [10.20.33.146] ([10.20.33.146]) by epmailtmp.qlogic.org with Microsoft SMTPSVC(5.0.2195.4905); Fri, 21 Feb 2003 17:01:13 -0600 Date: Fri, 21 Feb 2003 17:12:32 -0600 (CST) From: Brian Hurt X-X-Sender: Reply-To: Brian Hurt To: Ocaml Mailing List Subject: [Caml-list] Bitwise negation operator? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 21 Feb 2003 23:01:14.0111 (UTC) FILETIME=[220E48F0:01C2D9FD] Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Is there a bitwise negation operator I'm just missing? I'm looking for the equivelent of C's ~ operator. In Ocaml, it would have type int->int. In two's complement, I can implement this as either let lneg x = (-x) - 1 or: let lneg x = x lxor -1 I dislike depending upon being two's complement for bitwise negation. Brian ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners