I’ve set up a new kind of unit like so:
A floating point is a kind of value. 9.99 specifies a floating point with parts integer and fraction (optional, preamble optional).
A floating point times a floating point specifies a floating point.
Now although I gather I7 is supposed to handle arithmetic with units automatically, I’ve had to rewrite the way it does multiplying and dividing, as these answers come out wrong by default;
Not knowing how to do otherwise, I rewrote them like so:
To say (N - a floating point) * (M - a floating point):
This works fine for printing to the screen, but obviously when I want to assign values ingame, eg a = b * c, I still get I7’s mangled answers.
Looking through the documentation I found ‘decide’ mentioned and so tried:
To decide what is (N - a floating point) * (M - a floating point):
And if I then try: say 10.45 * 4.30, the above code is completely ignored.
Does anybody know what it is I should be doing?
Tangeantial but related: does anyone know if there are more detailed instructions you can give about displaying units? The only ones it seems to know are optional, preamble optional and without leading zeroes. What I need to do is fix it to not show trailing zeroes - ie, at the moment “8.4” is treated as 8.04, and “8.40” must be used for 8.4.