Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000547Core InformEquations, units, arithmeticpublic2011-02-09 15:302014-05-07 07:33
ReporterLaroquod 
Assigned Tograham 
PrioritynormalSeveritymildReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSMac OS XOS Version10.6
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0000547: Printing routines for arithmetic values with units depend on scale factors being powers of ten
DescriptionThe attached source gives

- - - -
"500KB plus 700KB" = filesize: 1.1729MB
- - - -

rather than the expected

- - - -
"500KB plus 700KB" = filesize: 1.1719MB
- - - -

The inexactness is due to flooring in the printing routine, e.g.:

- - - -
ran = rem*100/1024; print ran; rem = rem - ran*1024/100;
- - - -

Base ten scale factors are unaffected.
Minimal Source Text To Reproduce
There is a room.
Filesize is a kind of value. 1KB specifies a filesize. 1MB specifies a filesize scaled up by 1024.
When play begins:
	showme 500KB plus 700KB.
Additional InformationTaken, by request, from http://www.intfiction.org/forum/viewtopic.php?f=7&t=1864. [^]
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships
related to 0000548closedgraham Printing routines for arithmetic values with units do not change units for large negative values 

-  Notes
(0002610)
graham (administrator)
2014-04-03 03:13

There's no very good solution to this problem in 16-bit integer arithmetic, when the scale factor is close to a power of 10. I've slightly improved the accuracy, but really the solution is to use Glulx or real numbers. For what it's worth, this calculation now prints 1.1711 MB on Z, 1.1718 MB on G.

- Issue History
Date Modified Username Field Change
2011-02-09 15:30 EmacsUser New Issue
2011-02-09 15:30 EmacsUser Reporter EmacsUser => Laroquod
2011-02-09 15:32 EmacsUser Issue cloned 0000548
2011-02-09 15:32 EmacsUser Relationship added related to 0000548
2011-02-12 18:40 jmcgrew Status new => acknowledged
2011-02-13 20:23 EmacsUser Status acknowledged => confirmed
2014-04-03 03:13 graham Note Added: 0002610
2014-04-03 03:13 graham Status confirmed => resolved
2014-04-03 03:13 graham Resolution open => fixed
2014-04-03 03:13 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
Powered by Mantis Bugtracker