esi-docs icon indicating copy to clipboard operation
esi-docs copied to clipboard

ID Ranges has 'off by one' error somewhere

Open koshell opened this issue 1 year ago • 0 comments

I was reading through the docs to learn about the API and I found something odd. These id ranges don't make sense.

Consider this truncated version of the table:

From To Description
0 10,000 System items (including junkyards and other special purpose items)
~ ~ ~
50,000,000 60,000,000 Stargates
60,000,000 61,000,000 Stations created by CCP
~ ~ ~
2,100,000,000 2,147,483,647 DUST characters, EVE characters created after 2016-05-30

To ensure we all understand each other I'm defining ranges as such: '1 to 5 exclusive' means '1, 2, 3, 4' '1 to 5 inclusive' means '1, 2, 3, 4, 5'

With that table it isn't clear if the ranges are inclusive or exclusive. An ID of 60,000,000 could be a stargate or a station. Typically in these kinds of situation I assume the intent is exclusive ranges since that is the default behaviour in a lot of coding languages. With that assumption 60,000,000 would be a station and not a stargate.

However the last entry seems to contradict that assumption.

2,100,000,000 to 2,147,483,647

2,147,483,647 is the max value you can store in a 32-bit signed integer. Therefore I assume this is meant to be understood as "the rest of the integer is used for these IDs". However if we continue with the exclusive range assumption as before that would be it actually means "the rest of the integer, except the last value".

That seems like an odd range to choose. I assume it is incorrect (seems odd to reserve just the last value). Ideally the page would get updated with the correct ranges and it wouldn't hurt to explicitly state on the page if the range is inclusive or exclusive. As a bonus it be nice to specify the max integer size required to store the value but most people likely don't care about that.

koshell avatar Jun 15 '24 03:06 koshell