<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/11/6c51cac155fc19a70c332c51f09bb199"
  from="Jed Davis &lt;jdev@p...&gt;"
  author="Jed Davis"
  date="2003-11-07T03:46:32"
  subject="[Caml-list] Re: A grave bug in logical shift right op?"
  prev="2003/11/8e4bb7df1307031640c93d02c75186de"
  next="2003/11/839330ec827afc2945d89edbbaf6a8c3"
  prev-in-thread="2003/11/140c9fadd8e2355539503a016bc1e217"
  next-in-thread="2003/11/944504cb86937958edfda29223507e1c"
  prev-thread="2003/11/b3c779c49bd7be546f1e9fe0756e7d3d"
  next-thread="2003/11/8bac1133214edc5aaff0c5dae8053b9e"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] A grave bug in logical shift right op?">
<msg 
  url="2003/11/140c9fadd8e2355539503a016bc1e217"
  from="Eray Ozkural &lt;exa@k...&gt;"
  author="Eray Ozkural"
  date="2003-11-07T03:35:12"
  subject="[Caml-list] A grave bug in logical shift right op?">
<msg 
  url="2003/11/6c51cac155fc19a70c332c51f09bb199"
  from="Jed Davis &lt;jdev@p...&gt;"
  author="Jed Davis"
  date="2003-11-07T03:46:32"
  subject="[Caml-list] Re: A grave bug in logical shift right op?">
</msg>
<msg 
  url="2003/11/944504cb86937958edfda29223507e1c"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-11-07T03:53:40"
  subject="Re: [Caml-list] A grave bug in logical shift right op?">
<msg 
  url="2003/11/c476429bdc04d501fe234399b1022dcc"
  from="Eray Ozkural &lt;exa@k...&gt;"
  author="Eray Ozkural"
  date="2003-11-07T06:22:33"
  subject="Re: [Caml-list] A grave bug in logical shift right op?">
</msg>
</msg>
<msg 
  url="2003/11/f965cfe7869fbbf1d10dcfc9a4ef52ea"
  from="Andrew Lenharth &lt;andrewl@d...&gt;"
  author="Andrew Lenharth"
  date="2003-11-07T03:59:13"
  subject="Re: [Caml-list] A grave bug in logical shift right op?">
</msg>
</msg>
</thread>

<contents>
Eray Ozkural &lt;exa@kablonet.com.tr&gt; writes:

&gt; I'm using the debian package in testing....
&gt;
&gt; orion:fealn-attack$ ledit ocaml
&gt;         Objective Caml version 3.07+2
&gt;
&gt; # Printf.printf "%X" 0xffffffff;;
&gt; 7FFFFFFF- : unit = ()
&gt; # Printf.printf "%lx" (Int32.of_int 0xffffffff);;
&gt; ffffffff- : unit = ()
&gt; # -1 lsr 24;;
&gt; - : int = 127
&gt; # Int32.shift_right_logical (Int32.of_int (-1)) 24;;
&gt; - : int32 = 255l
&gt;
&gt; What's going on here? Something's eating the most significant bit in
&gt; both hexadecimal output routine and the logical shift right
&gt; operator. Somebody please help me! My cipher isn't working!!!

The size of an int is one bit less than the machine's word size, so 31
bits on a 32-bit arch; this is because the internal representation of
an OCaml value uses the LSB to distinguish between an int (stored in
the top n-1 bits) and some other kind of object.


-- 
Jed Davis &lt;jldavis@cs.oberlin.edu&gt;  Selling of self: http://panix.com/~jdev/rs/
&lt;jdev@panix.com&gt;  PGP&lt;-finger A098:903E:9B9A:DEF4:168F:AA09:BF07:807E:F336:59F9
\   "But life wasn't yes-no, on-off.  Life was shades of gray, and rainbows
/\   not in the order of the spectrum."  -- L. E. Modesitt, Jr., _Adiamante_

-------------------
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

</contents>

</message>

