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 WAA22107; Fri, 28 Mar 2003 22:18:18 +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 WAA22240 for ; Fri, 28 Mar 2003 22:18:15 +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 h2SLIEX29265 for ; Fri, 28 Mar 2003 22:18:15 +0100 (MET) Received: from epmailtmp.qlogic.org ([10.20.33.254]) by epexch01.qlogic.org with Microsoft SMTPSVC(5.0.2195.5329); Fri, 28 Mar 2003 15:18:58 -0600 Received: from [10.20.33.146] ([10.20.33.146]) by epmailtmp.qlogic.org with Microsoft SMTPSVC(5.0.2195.4905); Fri, 28 Mar 2003 15:18:57 -0600 Date: Fri, 28 Mar 2003 15:19:16 -0600 (CST) From: Brian Hurt X-X-Sender: Reply-To: Brian Hurt To: Ocaml Mailing List Subject: [Caml-list] Bug? Printf, %X and negative numbers Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 28 Mar 2003 21:18:57.0900 (UTC) FILETIME=[A50C0AC0:01C2F56F] X-Spam: no; 0.00; qlogic:01 bug:01 printf:01 3.06:01 ocaml:01 caml:01 unit:03 output:05 brian:06 objective:07 extension:10 isn't:11 lsl:13 hurt:13 case:16 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk $ ocaml Objective Caml version 3.06 # Printf.printf "%08X\n" (1 lsl 30);; C0000000 - : unit = () # Printf.printf "%010X\n" (1 lsl 30);; 00C0000000 - : unit = () # I expected output of 40000000, not C0000000. Note that this isn't a case of simple sign extension, as the second example demonstrates. Where'd the extra bit come from? 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