Android Question Long Int Compare Error

Maodge

Member
Licensed User
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
    长整型数比较错误.PNG
    53.9 KB · Views: 136
  • test-long-int-compare.zip
    9.1 KB · Views: 135

Star-Dust

Expert
Licensed User
Longtime User
? 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

agraham

Expert
Licensed User
Longtime User
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
Top