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
JRuby version: jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d Java HotSpot(TM) 64-Bit Server VM 25.20-b23 on 1.8.0_20-b26 +jit [darwin-x86_64], but the same bug appeared in older JRuby's too.
OS: Does not matter (at least OSX 10.11.3 and Oracle Linux 7)
Expected Behavior and Actual Behavior
We expect all global variable values are preserved between multiple invocations of invokeFunction from Java. However, when a numeric global variable is initialized by a Fixnum, it will always become a Fixnum even if we assign a Float to it. Because of that, the assigned values will lose fractional values.
before updating: var1=0 var2=0.0
after updating: var1=0.2 var2=0.2
before updating: var1=0 var2=0.2
after updating: var1=0.2 var2=0.4
As you can see, var2 (which is initialized by a Float 0.0) is updated correctly, but var1 (which is initialized by a Fixnum 0) will lose its fractional value at each iteration, which is wrong.
The text was updated successfully, but these errors were encountered:
Environment
Expected Behavior and Actual Behavior
We expect all global variable values are preserved between multiple invocations of invokeFunction from Java. However, when a numeric global variable is initialized by a Fixnum, it will always become a Fixnum even if we assign a Float to it. Because of that, the assigned values will lose fractional values.
Here is an example:
and the output:
As you can see, var2 (which is initialized by a Float 0.0) is updated correctly, but var1 (which is initialized by a Fixnum 0) will lose its fractional value at each iteration, which is wrong.
The text was updated successfully, but these errors were encountered: