|Anonymous | Login | Signup for a new account||2018-06-23 16:24 PDT|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000737||Core Inform||Equations, units, arithmetic||public||2011-09-01 12:46||2014-05-07 07:33|
|Target Version||Fixed in Version||6L02|
|Summary||0000737: Compiler generates unit scales too large for Z-code|
|Description||(From discussion in forum thread http://www.intfiction.org/forum/viewtopic.php?f=7&t=3104 [^] )|
The attached code, in Z-code, displays
One meter is 0.1km.
One centimeter is 0.1km.
Ten meters is 0.1km.
This is because the unit scale of kilometers is 100000, which doesn't fit in a Z-code word.
If we add the line "now L is 1km", the compiler would (correctly) error out saying: "You wrote 'now L is 1 km' but you use a literal specification to make a value which is too large, at least with the Settings for this project as they currently are." The attached code should throw a similar problem message, whether or not such a literal is used.
Theoretically a game could proceed correctly with these units, by never using lengths over 0.31km and never printing a value in kilometers at all. But I think that's too antsy to let go.
|Minimal Source Text To Reproduce|
The Kitchen is a room. Length is a kind of value. 1m (in metric units, in m) or 1 m (in metric units, in m) or 1 meter (in meters, singular) or 1 metre (in metres, singular) or 2 meters (in meters, plural) or 2 metres (in metres, plural) specifies a length. 1cm (in metric units, in cm) or 1 cm (in metric units, in cm) or 1 centimeter (in centimeters, singular) or 1 centimetre (in centimetres, singular) or 2 centimeters (in centimeters, plural) or 2 centimetres (in centimetres, plural) specifies a length scaled down by 100. 1km (in metric units, in km) or 1 km (in metric units, in km) or 1 kilometer (in kilometers, singular) or 1 kilometre (in kilometres, singular) or 2 kilometers (in kilometers, plural) or 2 kilometres (in kilometres, plural) specifies a length scaled up by 1000. When play begins: let L be 1 m; say "One meter is [L]."; now L is 1 cm; say "One centimeter is [L]."; now L is 0.01 km; say "Ten meters is [L].";
|Tags||No tags attached.|
|Effect||(serious/mild) Game compiles but misbehaves|
|2011-09-01 12:46||zarf||New Issue|
|2011-09-07 04:58||EmacsUser||Status||new => confirmed|
|2014-04-03 01:40||graham||Note Added: 0002609|
|2014-04-03 01:40||graham||Status||confirmed => resolved|
|2014-04-03 01:40||graham||Resolution||open => fixed|
|2014-04-03 01:40||graham||Assigned To||=> graham|
|2014-05-07 07:32||jmcgrew||Fixed in Version||=> 6L02|
|2014-05-07 07:33||jmcgrew||Status||resolved => closed|
|Copyright © 2000 - 2010 MantisBT Group|