MantisBT - Core Inform
View Issue Details
0001935Core InformEquations, units, arithmeticpublic2016-07-27 07:042016-07-27 07:40
mattweiner 
 
normalmildalways
confirmedopen 
MacintoshEl Capitan10.11.5
6M62 
 
(serious/mild) Game compiles but misbehaves
0001935: totals of real-numbered specified units are wrong
When taking the total of a set of values specified as a real number unit (1.0 kg), the total comes out as an impossibly large number when it should be 2.0 kg.
Lab is a room.

A weight is a kind of value.
1.0 kg specifies a weight.
Everything has a weight.

A rock and a stone are in Lab.

The weight of the rock is 1.0 kg. The weight of the stone is 1.0 kg.

When play begins:
say "Total weight: [total weight of things in the Lab]."
Output:


Total weight: 1.70141 × 10^38 kg.

Welcome
An Interactive Fiction
Release 1 / Serial number 160727 / Inform 7 build 6M62 (I6/v6.33 lib 6/12N) SD

Lab
You can see a rock and a stone here.

>
No tags attached.
Issue History
2016-07-27 07:04mattweinerNew Issue
2016-07-27 07:09mattweinerNote Added: 0004492
2016-07-27 07:40zarfNote Added: 0004493
2016-07-27 07:40zarfStatusnew => confirmed

Notes
(0004492)
mattweiner   
2016-07-27 07:09   
This also happens if we use the Metric Units extension.

Source:

Lab is a room.

Include Metric Units by Graham Nelson.

Everything has a mass.

A rock and a stone are in Lab.

The mass of the rock is 1.0kg. The mass of the stone is 1.0kg.

When play begins:
say "Total weight: [total mass of things in the Lab]."

Output:

Total weight: 1.70141 × 10^35 tonnes.
(0004493)
zarf   
2016-07-27 07:40   
Confirmed. The total-property-value routine (Prop_1 in this example) uses integer addition whether the value is integer or real.