How to store long numbers in an array? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Posts: 74
Joined: 18 May 2017, 10:56

How to store long numbers in an array?

18 Jul 2018, 07:39

I want to store very large numbers (~100 digits long) in an array. How to do that and what is the Max limit?

Code: Select all

VarSetCapacity(MyArray, 10240000)
VarSetCapacity(MyVar, 10240000)
MyArray := []
MyVar := 10
MyArray[0] := MyVar + 33300000000000000000
MsgBox % MyArray[0]       ;;; returns -9223372036854775799
Posts: 5389
Joined: 30 Sep 2013, 06:48

Re: How to store long numbers in an array?  Topic is solved

18 Jul 2018, 07:48 :
Commands, functions, and expressions that accept numeric inputs generally support 15 digits of precision for floating point values. For integers, 64-bit signed values are supported, which range from -9223372036854775808 (-0x8000000000000000) to 9223372036854775807 (0x7FFFFFFFFFFFFFFF). Any integer constants outside this range are not supported and might yield inconsistent results. By contrast, arithmetic operations on integers wrap around upon overflow (e.g. 0x7FFFFFFFFFFFFFFF + 1 = -0x8000000000000000).
If you don't want to do maths with it, try storing them as strings (via quotation marks)...

There is also this maths library: ... s-library/ ... /Maths.ahk
I think it can evaluate bigger numbers if they are stored as strings...


Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], punchin, scriptor2016, sobuj53, TAC109, Xeo786 and 31 guests