Documentation bug?

When looking at the extra attributes documentation, I noticed that the integer ranges indicate 2’s complement unsigned integer magnitudes but have the symbol for + or - that value indicating signedness. Is it signed or unsigned? If it’s signed, the magnitudes are double what they should be. If it’s unsigned, the sign symbols need removing.

3 Likes

Thanks. After a bit of experimenting, turns out it’s signed integers indeed. Changed to:

  • 8 bit: -128 to 127
  • 16 bit: -65,535 to 65,534
  • 32 bit: -4,294,967,295 to 4,294,967,294
  • 64 bit: -18,446,744,073,709,551,615 to 18,446,744,073,709,551,614
3 Likes

Except the range of -65536 to 65535 requires 17 bits. It should be -32768 to 32767 for 16 bits. Likewise the max signed value of 32 bits is 2 billion something. It’s computed as 2^(n-1)-1 for maximum and -(2^(n-1)) for minimum. 2^n is the total number of combinations of patterns, positive and negative.

2 Likes

Whoops, you’re right. I forgot and only halved numbers for 8bit… :slight_smile: Will fix.

2 Likes

Thanks! I was starting to look where to file the patch against but the workshop portion of the userguide doesn’t appear to be part of the HaikuWebsite repo.

1 Like

The user guide is managed entirely in the “userguide translator” app and not in Git. Editing it is behind a specific login wall. Hopefully iy will sometime be converted to the new Haiku Single Sign-On?

1 Like