Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000850Core InformEquations, units, arithmeticpublic2012-01-27 18:402014-05-07 07:33
Reporterektemple 
Assigned Tograham 
PrioritynormalSeveritymildReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSMac OS XOS Version10.6
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0000850: RoundOffTime() doesn't properly handle negative numbers
DescriptionThe "to the nearest" phrase for rounding doesn't properly handle negative inputs. The two cases in the provided source should both produce -45; instead, the first outputs -40, while the second produces 0.
Minimal Source Text To Reproduce
Test is a room.

When play begins:
	say "[-46 to the nearest 5].";
	say "[-63 to the nearest 45]."
Additional InformationSomething like this should fix it; though there are probably more elegant solutions:

[ RoundOffValue t1 t2;
if (t1 >= 0) return ((t1+t2/2)/t2)*t2;
t1 = 0 - t1;
return -((t1+t2/2)/t2)*t2;
];
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
(0002605)
graham (administrator)
2014-04-02 13:27

I've accepted this fix - thanks.

- Issue History
Date Modified Username Field Change
2012-01-27 18:40 ektemple New Issue
2012-01-28 10:45 EmacsUser Reproducibility have not tried => always
2012-01-28 10:45 EmacsUser Status new => confirmed
2014-04-02 13:27 graham Note Added: 0002605
2014-04-02 13:27 graham Status confirmed => resolved
2014-04-02 13:27 graham Resolution open => fixed
2014-04-02 13:27 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