I have this string in a text file:
A Java project that I am trying to convert to B4J as well as my B4J project both logs this correctly (let call it an X and Y value separated by a ","
In both the B4J and Java projects the following applies:
The confusing part is this:
With the same initial value (x = 448.12024391174316 and y = 262.125) the calculation results are as follows:
B4J re value = -26.616565036773686
B4J im value = -72.59943181818183
Java re value = -31.93987804412842
Java im value = -87.11931818181819
With my calculator I calculate the results of re and im to be the same as that of the B4J code.
What is happening here? Why the difference?
B4X:
448.12024391174316,262.125
A Java project that I am trying to convert to B4J as well as my B4J project both logs this correctly (let call it an X and Y value separated by a ","
In both the B4J and Java projects the following applies:
B4X:
width = 1280 'declared as an int
height = 720 'declared as an int
minusheight = height / 1.65 'declared as Double
minuswidth = width / 2.5 'declared as Double
devide = height / 300 'declared as Double
The confusing part is this:
B4J code:
Dim c As ComplexNumber
c.Initialize((s.substring2(0, comaindex) - minuswidth) / devide, _
(s.substring2(comaindex + 1, s.length()) - minusheight) / devide)
X.add(c)
Log("c.re = " & c.re)
Log("c.im = " & c.im)
Java code:
ComplexNumber c = new ComplexNumber((Double.valueOf(s.substring(0, comaindex)) - minuswidth) / devide,
(Double.valueOf(s.substring(comaindex + 1, s.length())) - minusheight) / devide);
X.add(c);
BA.Log("c.re = " + (Double.valueOf(s.substring(0, comaindex)) - minuswidth) / devide);
BA.Log("c.im = " + (Double.valueOf(s.substring(comaindex + 1, s.length())) - minusheight) / devide);
With the same initial value (x = 448.12024391174316 and y = 262.125) the calculation results are as follows:
B4J re value = -26.616565036773686
B4J im value = -72.59943181818183
Java re value = -31.93987804412842
Java im value = -87.11931818181819
With my calculator I calculate the results of re and im to be the same as that of the B4J code.
What is happening here? Why the difference?