Maodge Member Licensed User May 1, 2020 #1 hello, recently I need compare two long int numbers. but the result is err. B4X: Dim a As Long Dim b As Long a = 8866754384309352738 b = 8866754384309352738 If a = b Then Log("ok") Else Log("err") End If result log is err as attach pic show. what is wrong? thanks Attachments 长整型数比较错误.PNG 53.9 KB · Views: 412 test-long-int-compare.zip test-long-int-compare.zip 9.1 KB · Views: 331
hello, recently I need compare two long int numbers. but the result is err. B4X: Dim a As Long Dim b As Long a = 8866754384309352738 b = 8866754384309352738 If a = b Then Log("ok") Else Log("err") End If result log is err as attach pic show. what is wrong? thanks
Star-Dust Expert Licensed User Longtime User May 1, 2020 #2 ? Following this post I would say to try so B4X: Dim a As Long Dim b As Long a = 8866754384309352738 b = 8866754384309352738 If (b = a) Then Log("ok") Else Log("err") End If Upvote 0
? Following this post I would say to try so B4X: Dim a As Long Dim b As Long a = 8866754384309352738 b = 8866754384309352738 If (b = a) Then Log("ok") Else Log("err") End If
Maodge Member Licensed User May 1, 2020 #3 I test other variable types, byte, short, int compare two numbers of these type, result is ok Upvote 0
agraham Expert Licensed User Longtime User May 1, 2020 #4 I'm running your example unchanged. This only seems to happen when using the default debugger, and only when breakpoints are set in Activity_Create. Interestingly if I set a breakpoint only on line 38 of the program it crashes with a java.lang.RuntimeException: anywheresoftware.b4a.B4AUncaughtException when I rotate the device. All is fine in both release modes and when using the legacy debugger. I think Erel needs to comment on this. Upvote 0
I'm running your example unchanged. This only seems to happen when using the default debugger, and only when breakpoints are set in Activity_Create. Interestingly if I set a breakpoint only on line 38 of the program it crashes with a java.lang.RuntimeException: anywheresoftware.b4a.B4AUncaughtException when I rotate the device. All is fine in both release modes and when using the legacy debugger. I think Erel needs to comment on this.
Erel B4X founder Staff member Licensed User Longtime User May 3, 2020 #5 It is a bug in the debugger. As @agraham wrote it will only happen when there is a breakpoint in the sub or that it was modified without making a full compilation (clean project). It is fixed for the next version. Upvote 0
It is a bug in the debugger. As @agraham wrote it will only happen when there is a breakpoint in the sub or that it was modified without making a full compilation (clean project). It is fixed for the next version.