News for hackers. Stuff that matters.
Re:A complete map of the Rust type system by craftkiller on Monday September 08, 2025 @03:31PM (#45172804)
Eh, how often are you going down to the bit representation of signed integers? Naturally I learned two's complement ages ago, but all of my bitwise manipulation seems to be on unsigned integers (and frankly I've only used bitwise operations at work once for implementing bloom filters. Normally I only get to do lower level stuff like that in side-projects). So internalizing two's complement has never seemed relevant.

> And a byte value of 128? What is that in hex?

0x80

Re:A complete map of the Rust type system by jibal on Tuesday September 09, 2025 @12:12AM (#45177310)
> 0x80

Which is of course has the sign bit set.

The comments here are educational ... I hadn't realized that the field of programming had become this degraded.

Re:A complete map of the Rust type system by superblas on Tuesday September 09, 2025 @12:21PM (#45184266)
Such needless condescension, jibal.
Re:A complete map of the Rust type system by craftkiller on Tuesday September 09, 2025 @06:15PM (#45190080)
On the contrary, there is no sign bit. You asked for 128 which is either:

  1. Unrepresentable in S8
  2. Representable in U8 as shown in my above comment.
  3. Representable in S16 as 0x0080 but then the sign bit is not set.
My comment accurately represents the hex encoding for #2.
Re:A complete map of the Rust type system by jibal on Wednesday September 10, 2025 @01:17PM (#45200805)
> Such needless condescension, jibal.

THAT comment is condescending--talk about ideas, not people. I condescended to no one ... my issue is the state of computer science education.

> On the contrary, there is no sign bit. You asked for 128

I didn't ask for anything. The subject here was the value range of the i8 type.

Re:A complete map of the Rust type system by craftkiller on Wednesday September 10, 2025 @07:29PM (#45205593)
> I didn't ask for anything.

To quote you: "What is that in hex?"