View Issue Details

IDProjectCategoryView StatusLast Update
0030688RunnerVariables (Object/Instance)Public2019-05-08 16:13
ReporterStewart BishopAssigned ToFritz 
PriorityLowSeverityC - GeneralReproducibility100%
Status ClosedResolutionNot Fixable 
Product Version2.2.2 
Target VersionFixed in Version 
Summary0030688: Variables: Flooring a variable can sometimes give unexpected results
DescriptionWhen attempting to floor an incremented variable in this users sample it works fine for every 0.1 increment except 0.9 and 1 at which point the floored value returned isn't 0.9 or 1 but instead 0.89 and 0.99.
Steps To Reproduce1) Run the sample
2) Check the output for 90 and 100
3) See that these are floored to 89 and 99
TagsRunner
1.4 Found In
2.x Runtime Found In2.2.2.326
2.x Runtime Verified In9.9.1.1431

Activities

Stewart Bishop

2019-04-15 11:13

Adminstrator  

FloorIssue.yyz (19,978 bytes)

Fritz

2019-04-16 14:00

Developer   ~0063633

The sample is flooring 0.9*100 and getting 89, this is due to float numbers not being precise, 0.9 is very possibly 0.899999999 in floating point representation, therefore it gets multiplied by 100 to give 89.999999 which when floored is 89

That's just the way floating point maths works.