Bytes in java are signed values [-128,127]. I've submitted a ticket to add a ubyte function which simply checks for [0,255]. Note that this only deals with down-casting. Shift functions work on ints, thus you'd need to mask the byte to an int with (bit-and % 0xFF). If you don't do this, then when the MSB of the byte is 1, the up-converted int will be left-padded with 1s instead of 0s.
On Mar 28, 12:06 pm, Glen Rubin <rubing...@gmail.com> wrote: > I am working with 2's complement hex. It looks like i can get the > value of any number by just using byte? > e.g.: > (byte 0xff32) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en To unsubscribe from this group, send email to clojure+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.