Integer overflow [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Mon 2007-06-11 14:13
Integer overflow

I went into town at lunchtime to run errands, and parked in Lion Yard. Rather to my surprise, this was a completely different car park from the one I parked in last time I went to Lion Yard: the Grand Arcade building project has evidently progressed to the stage where they can activate the new piece of car park and (presumably) shut down the old one to start refurbishing that.

It's mostly just a car park, but it has one or two notable oddities in its design. Firstly, even its lowest floor is a long way up in the air, and access is via an extremely long helical ramp which guarantees that by the time you get up to the car park itself you won't have the faintest idea how you're oriented relative to the shops, and hence you don't know which set of lifts to use to avoid having to walk round the entire outside of the building to get to where you really wanted to be. There seemed to be a dearth of useful signs to tell you what was where; perhaps they're going to put those up later.

Secondly, and most delightfully, there's a pair of adjacent lifts on the south side. One is labelled ‘South Lift, Levels 2 – 4’. The other sign, and I had to stare at this for a couple of minutes before I convinced myself that it really said what I thought I was seeing, reads ‘South Lift, Levels 2 – -1’. Really. Two to minus one. On a huge, beautifully presented, professional-looking sign, and moreover on a sign ten metres away from one that makes sense. To add to the visual jar, the dash and the minus sign are at different heights, which is presumably just a question of how the font they were using happened to be designed.

I'm quite tempted to go back with a camera and take a photo of it before they realise and correct it.

LinkReply
[identity profile] thedancingfairy.livejournal.comMon 2007-06-11 13:26
That sounds fun. I think we need a pic to see it though.
Link Reply to this
[personal profile] gerald_duckMon 2007-06-11 13:30
They might really have meant it: sometimes the ground floor is considered 0 and basements are then numbered -1, -2, etc.

The car park for the Casino Royale in Monte Carlo is even more confusing because it's on a hillside so there are only two or three levels in any one place, but a dozen or so overall. I think they number from something like -4 to +7, from memory.
Link Reply to this | Thread
[personal profile] simontMon 2007-06-11 13:31
But in that case, surely the negative number would be listed first: -1 to 2, not 2 to -1.
Link Reply to this | Parent | Thread
[identity profile] valkyriekaren.livejournal.comMon 2007-06-11 13:32
Presumably the sign was on Floor 2?
Link Reply to this | Parent | Thread
[personal profile] simontMon 2007-06-11 13:35
The sign is at ground level. Car park level 2 is about three normal-floor-heights above that (going by the feel of my legs after climbing the stairs – in addition to being bizarrely labelled, the lifts weren't actually working yet).
Link Reply to this | Parent | Thread
[personal profile] aldabraMon 2007-06-11 16:10
Haaang on. They're labelling a lift "floors 2 to 4" on a floor which isn't in the interval [2...4]? But it is in the interval [-1...2]?

So, floor 2 is the first floor of carpark? And therefore the default ingress to the arcade. So clearly you label everything with reference to floor 2. I think these signs [2...4] and [-1...2] (ok, [2...-1]) ought to be installed on level 2. But then clearly lift [2...4] ought not to be instantiated on the ground floor.

What happens in -1?
Link Reply to this | Parent | Thread
[personal profile] simontMon 2007-06-11 16:20
They're labelling a lift "floors 2 to 4" on a floor which isn't in the interval [2...4]?

Well, yes; they're telling you what floors it'll take you to other than the one you're currently on. That may be mathematically dodgy but common-sense-wise it's perfectly reasonable!
Link Reply to this | Parent
[identity profile] feanelwa.livejournal.comMon 2007-06-11 16:41
Oh right, I see. So the lift for 2-4 has a door on the car park floor, and it takes you up to 2, 3 and 4, and the lift for -1-2 takes you to the basement, ground floor, 1 and 2, one of which is the floor you're already on in the car park. Shops are taller than car parks, so I suppose the bottom layer of shops covers floors G and 1, and the top layer of shops is floors 2 and 3 and possibly 4. So if you know you want to go to the top layer of shops or car park levels 3 and 4 you get in that lift right there without having to pootle about with people who are going to the bottom floors, and if you are going to the bottom floor to work your way up you are assumed to be Slow and therefore can share your lift with the people who got the bus or parked on floors G and 1 and the basement.
Link Reply to this | Parent
[personal profile] gerald_duckMon 2007-06-11 13:37
Well, perhaps. But if they'd meant "2 to 1" it should have been "1 to 2", similarly.

Any idea what it was supposed to say?
Link Reply to this | Parent | Thread
[personal profile] simontMon 2007-06-11 13:39
Not really; since the lift was broken, I wasn't able to get into it and find out what floors it was really prepared to take me to. The lift next to it is labelled 2 to 4, so an obvious guess might be that the two lifts go the same distance, but it is only a guess.
Link Reply to this | Parent
[identity profile] pseudomonas.livejournal.comMon 2007-06-11 13:42
It could have been produced by a right-to-left-language-using signpainter?
Link Reply to this | Parent
[identity profile] ptc24.livejournal.comMon 2007-06-11 15:09
The conference center in Atlanta was likewise on a hillside, but they were boring, you just went in on the 5th floor, and went down (and along, and along, and along...) to the ground floor to get to the exit on the other side of the building.

Funny place. Then again Atlanta was a funny place wlog.
Link Reply to this | Parent
[identity profile] cartesiandaemon.livejournal.comMon 2007-06-11 13:40
Confused -- you think they *meant* floor 4,294,967,295?
Link Reply to this | Thread
[identity profile] ewx.livejournal.comMon 2007-06-11 13:44
When they say "grand" arcade they are NOT messing about.
Link Reply to this | Parent | Thread
[identity profile] pseudomonas.livejournal.comMon 2007-06-11 13:47
Surely that would imply a thousand floors?
Link Reply to this | Parent | Thread
[identity profile] ewx.livejournal.comMon 2007-06-11 15:13
Yes, in the same way as a grand piano has 1,000 keys.
Link Reply to this | Parent
[identity profile] cartesiandaemon.livejournal.comMon 2007-06-11 13:53
Surely a "grand" arcade would be 1023 floors? You know your engineering is getting good when its exponential increase outstrips that of the size of your standard integers. (For reference, a car park 4294967295 floors high would reach something like 1/3 of the way to the orbit of mars. Of course, you might introduce some kind of fractal squeezing to fit an endless carpark in a finite height, but then some buggers going to come along and Hilbert you up :))
Link Reply to this | Parent | Thread
[identity profile] feanelwa.livejournal.comMon 2007-06-11 14:25
I'm fairly sure going up a spiral ramp that goes a third of the way to Mars would make anybody too dizzy to park! Not to mention e.g. the lack of air, and all that.

Still, shoppers would be even more inclined to buy things in chain stores then.
Link Reply to this | Parent | Thread
[identity profile] cartesiandaemon.livejournal.comTue 2007-06-12 12:44
I calculate you'd experience about 6G at the top, climbing mightn't be necessary. But that wasn't as insane as I expected it was, I'm not sure if I multiplied correctly. The *building* I'm sure would be destroyed though.
Link Reply to this | Parent
[identity profile] cartesiandaemon.livejournal.comMon 2007-06-11 13:46
I'm not sure what they *did* mean. I would have assumed the sign would have been written by a human. But it sounds like the sort of snafu that could only have come out of software. If the signs are automatically produced it could make sense (-1 is a placeholder, -1 means floor -1 but the ordering is screwed up, etc). But I'm sure I'm missing something.

For all I know, it's like HP Staion 9 3/4 or Being John Malkovich floor 7 1/2, and if you'd been able to get in you'd have been whisked to the top floor *the day before*.
Link Reply to this | Parent
[identity profile] pseudomonas.livejournal.comMon 2007-06-11 13:46
I note that the Burj Dubai (http://en.wikipedia.org/wiki/Burj_Dubai) has enough floors to give this problem with 8-bit signed ints.
Link Reply to this | Parent | Thread
[identity profile] cartesiandaemon.livejournal.comMon 2007-06-11 13:56
But completed in 2008 -- I predict by then we'll have default int sizes greater than 8 bits :) But lol.

To actually break the int, you probably need to go back in time to when someone cleverly encoded a floor in one or two bits, but buildings were already higher :)
Link Reply to this | Parent | Thread
[identity profile] pseudomonas.livejournal.comMon 2007-06-11 14:35
You might need to be a termite for this.
Link Reply to this | Parent
[identity profile] xaosenkosmos.livejournal.comMon 2007-06-11 18:49
-1 is indexing the floors from the top down (http://www.perl.com/doc/FMTEYEWTK/style/slide16.html), with -1 being the last floor. Every perl hacker knows that!
Link Reply to this
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]