![]() | Chapter 14: Units | ![]() ![]() |
14.11. Limits on the size of numbers |
There are still some serious restrictions. Inform has only whole numbers, not floating-point (though we could in principle simulate at least fixed-point numbers by writing something like "10.99kg specifies a weight"). And it only allows numbers from -32768 to 32767. Since a London bus only weighs 7000kg, 32000kg is plenty: on the other hand, if we wanted to measure weight in grammes instead, the limit would be just 32kg, an amount which a human can just about lift.
The limit also begins to bite when using multiple-number specifications. Internally, Inform stores the above "running time" as a number of seconds, so that 3'59 is actually stored as 239. Calculating the maximum legal running time is a nuisance, so we can instead check the "Kinds" page of the index, where we read that:
running time (plural running times)
Written in the following form: 3'59
Maximum value allowed: 546'07
The maximum legal running time is therefore a little over 9 hours, so the new Tori Amos album will not be a problem, but some of the more punishing German operas might break the bank.
These restrictions are a nuisance, but can normally be managed, and we gain the ability to run the resulting work of IF on a very wide variety of computers indeed, some extremely small.
Previous | Contents | Next |