You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There appear to be two situations where values (or lack thereof) in
@@cached_units seem to adversely affect the scalar values of units that are
created or converted.
The issues that have been observed are as follows:
Firstly, when creating two identical Units one after the other, the first time,
(when the unit type in question is not in the cache), the float value that is
passed in is converted to an integer/fixnum scalar value.
For example:
There appear to be two situations where values (or lack thereof) in
@@cached_units seem to adversely affect the scalar values of units that are
created or converted.
The issues that have been observed are as follows:
Firstly, when creating two identical Units one after the other, the first time,
(when the unit type in question is not in the cache), the float value that is
passed in is converted to an integer/fixnum scalar value.
For example:
However, if we then immediately create another identical Unit, the float value
is converted to a Float scalar value.
Secondly, this situation also affects the result if the units are converted to
the same units after they are created:
Furthermore, the scalar above, ending up as a float, loses precision (it is
originally passed in as 81.0):
I have created some tests which illustrate the issue, which you can see here:
master...agworld:float-cache-issue
The text was updated successfully, but these errors were encountered: