Minimum integer in words

I think I’ve found a bug in Inform 7, and I thought I would check here before officially reporting it. Basically, Inform 7’s “in words” command won’t print the name of the minimum integer allowed by Glulx.

Here’s some code:

VERYSMALL is always -2147483647. minimum-testing is an action out of world. Understand "minimum" as minimum-testing. Carry out minimum-testing: let newnumber be VERYSMALL; say "The minimum integer in Glulx is almost [newnumber], which is [newnumber in words].[paragraph break]"; let newnumber be newnumber - 1; say "The minimum integer in Glulx actually is [newnumber], which is [newnumber in words].[paragraph break]"; let newnumber be newnumber - 1; say "But the maximum integer in Glulx is [newnumber], which is [newnumber in words].[paragraph break]".

And here’s a transcript:

[code]>minimum
The minimum integer in Glulx is almost -2147483647, which is minus two billion, one hundred and forty-seven million, four hundred and eighty-three thousand, six hundred and forty-seven.

The minimum integer in Glulx actually is -2147483648, which is minus .

But the maximum integer in Glulx is 2147483647, which is two billion, one hundred and forty-seven million, four hundred and eighty-three thousand, six hundred and forty-seven.[/code]

Inform 7 handles printing -2147483647 and 2147483647 in words just fine, but not -2147483648 in words. Instead, it prints nothing at all.

Am I right in thinking this is a bug in Inform, or am I missing something?

I’d say this is a bug in Inform 6.

The relevant code is in the I6 library (function LanguageNumber in file english.h). The routine for printing a number N in words begins by checking whether N is negative; if it is, it prints “minus”, and replaces N with -N. The remainder of the routine then assumes that N is positive. Unfortunately, if N is the minimum integer, then -N = N, so that assumption doesn’t work very well.

Thank you! That makes sense. I’ll report the bug with the Inform bug tracker soon.