Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6764517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:36:13+00:00 2026-05-26T14:36:13+00:00

i am using big numbers (18 digits), so i store it into long variables.

  • 0

i am using big numbers (18 digits), so i store it into long variables.
I have found some misbehavior in my calculations, hence i made a simple test program.

The calculation does not work as it should with big numbers…
More precise it is linked to the Map i use for storing.
Any suggestions?

    'Activity module
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim b1,b2,b3 As Button
    Dim MapData As Map
End Sub

Sub Activity_Create(FirstTime As Boolean)
    b1.Initialize("Set100")
    b1.Text="Set100"
    Activity.AddView(b1,10%x,10%y,80%x,20%y)
    b2.Initialize("SetBig")
    b2.Text="SetBig"
    Activity.AddView(b2,10%x,40%y,80%x,20%y)
    b3.Initialize("Increase")
    b3.Text="long++"
    Activity.AddView(b3,10%x,70%y,80%x,20%y)
    MapData.Initialize
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Set100_Click
    Dim l As Long
    l = 100
    Log("set to: " & l)
    MapData.Put("Token",l)
End Sub

Sub SetBig_Click
    ' long range: -9223372036854775808 to 9223372036854775807
    Dim l As Long
    l = 640345893847300380
    Log("set to: " & l)
    MapData.Put("Token",l)
End Sub

Sub Increase_Click
    Dim l As Long
    l = MapData.Get("Token")
    Log("from map: " & l)
    l = l + 1
    Log("new val : " & l)
    MapData.Put("Token",l)
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:36:13+00:00Added an answer on May 26, 2026 at 2:36 pm

    You are correct. There is a bug in the conversion from an unknown object to Long which causes this error. This bug will be fixed in the next update.
    In the meantime you can create a custom type and store it instead.

    Sub Globals
        'These global variables will be redeclared each time the activity is created.
        'These variables can only be accessed from this module.
        Dim b1,b2,b3 As Button
        Dim MapData As Map
        Type MyLong(l As Long)
    End Sub
    
    Sub Activity_Create(FirstTime As Boolean)
        b1.Initialize("Set100")
        b1.Text="Set100"
        Activity.AddView(b1,10%x,10%y,80%x,20%y)
        b2.Initialize("SetBig")
        b2.Text="SetBig"
        Activity.AddView(b2,10%x,40%y,80%x,20%y)
        b3.Initialize("Increase")
        b3.Text="long++"
        Activity.AddView(b3,10%x,70%y,80%x,20%y)
        MapData.Initialize
    End Sub
    
    Sub Activity_Resume
    
    End Sub
    
    Sub Activity_Pause (UserClosed As Boolean)
    
    End Sub
    
    Sub Set100_Click
        Dim l As Long
        l = 100
        Log("set to: " & l)
        MapData.Put("Token",l)
    
    End Sub
    
    Sub SetBig_Click
        ' long range: -9223372036854775808 to 9223372036854775807
        Dim l As MyLong
        l.l = 640345893847300380
        Log("set to: " & l)
        MapData.Put("Token",l)
    End Sub
    
    Sub Increase_Click
        Log(MapData.Get("Token"))
        Dim l As MyLong
        l = MapData.Get("Token")
        l.l = l.l + 1
        'If you want to create a copy of the original MyLong object:
        Dim l2 As MyLong
        l2.l = l.l
        Log("new val : " & l.l)
        MapData.Put("Token",l2)
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing some math with really big numbers (I'm using Python, but this question
Using GMP on c, I have a big integer mpz_t n in decimal form,
I am using really big numbers (milions) on my x-axis, so when I use
i have a really big array of numbers with double precision...i tried to write
i've made a little script to calculate prime numbers, i'm using the latest xampp
Can someone clarify why ruby returns such big numbers when using to_r for example:
I'm working with large numbers that I can't have rounded off. Using Lua's standard
I had quite a big list of numbers. I needed to apply some operation
Problem: I am using a big C/C++ code base which works on gcc &
We are developing a considerably big application using Ruby on Rails framework (CRM system)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.