# How do i deal with a number that's too big?

## Recommended Posts

alright... so i have this loooong number . . .

0xB0E41803A8E4180328E51803740C1E03C0E41803A8E4180328E51803740C1E03

and i want to do certain types of arithmetic w/ it... such as addition/subtraction and bitshifting . . . problem is well.. the number is too big to store to a variable >_<... so how can i go about performing these operations?

##### Share on other sites

alright... so i have this loooong number . . .

0xB0E41803A8E4180328E51803740C1E03C0E41803A8E4180328E51803740C1E03

and i want to do certain types of arithmetic w/ it... such as addition/subtraction and bitshifting . . . problem is well.. the number is too big to store to a variable >_<... so how can i go about performing these operations?

That should not be a problem, autoit can't have line exceed 1024.

```\$sString = "rwrwerereVeryLongddddddddddd" & _
"tewtetnext line joining"```

Oops, sorry. I thought you convert the number to HEX to post it here(did not even check the HEX yet)

Edited by athiwatc

##### Share on other sites

The following wikipedia article contains a useful introduction to arbitrary precision arithmetic. There are also links to some free function libraries code that it should be possible to convert into AutoIt code. It is however likely to be very slow. This sort of stuff is very slow, even when implemented in C

http://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic

Edited by Bowmore

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

##### Share on other sites

Well, addition/subtraction and bitshifting will not be slow. In principle there is nothing complicated. Just work with the digits of two numbers, starting with the last one and convert to the string. I'll be glad if somebody will make the working UDF for AutoIt.

##### Share on other sites

**edited**

Edited by SomeoneHere

##### Share on other sites

alright, so now i gotta change what i was doing... the thing is i use MemoryRead (from NomadMemory.au3) to read which is the size of "char[32]" . . . i have everything working fine but now i have a problem... sometimes when i go to read char[32], it doesn't read it all, it only reads the first 16 dwords . . . any solutions for this? . . . i need to get all 32 dwords >_< and i can't read them separately because it's constantly changing

Edited by SomeoneHere

##### Share on other sites

alright, so now i gotta change what i was doing... the thing is i use MemoryRead (from NomadMemory.au3) to read which is the size of "char[32]" . . . i have everything working fine but now i have a problem... sometimes when i go to read char[32], it doesn't read it all, it only reads the first 16 dwords . . . any solutions for this? . . . i need to get all 32 dwords >_< and i can't read them separately because it's constantly changing

If you need to read 32 DWORDs why do you use char[32] which is 32 bytes? I would have thought that char[32] would only read the first 8 DWORDS. Are you sure they are dwords and not words? Why not use char[128] for 32 dwords or char[64] for 32 words?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

## Create an account

Register a new account