mapbox / vector-tile-spec

Mapbox Vector Tile specification
https://www.mapbox.com/vector-tiles/specification/
Other
892 stars 210 forks source link

Incorrect Parameter Integer Range #52

Closed flippmoke closed 8 years ago

flippmoke commented 8 years ago

Currently in our description of ParameterIntegers we specify the range to be:

Parameter values greater than pow(2,31) - 1 or less than -1 * (pow(2,31) - 1) are not supported.

This is incorrect it should likely be:

Parameter values greater than pow(2,30) - 1 or less than -1 * pow(2,30) - 1 are not supported.

This is an oversight be me as I was writing the specification. The minimum value is assuming non two's complement int32 we are storing.

flippmoke commented 8 years ago

Ugh... sorry binary is killing me today, give me a bit to correct my wording about the min value...

flippmoke commented 8 years ago

Sorry, doubted myself on what I posted originally before editing the post..

Parameter values greater than pow(2,30) - 1 or less than -1 * pow(2,30) are not supported.

We can go to -1 * pow(2,30) assuming the system's definition of int32 is two's complement, otherwise it would be -1 * (pow(2,30) - 1) on a one's complement system (I don't think we will ever run into that though?)

kkaefer commented 8 years ago

The original (pow(2,31) - 1) is correct for two's complement. I don't think we should take one's complement into account since it rarely ever occurs in practice. Implementors on such systems (should they even exist) just have to use a wider number type.

flippmoke commented 8 years ago

@kkaefer you are right nothing should change lol.