Handling numbers larger than Long in VBA

I am currently trying to write code in VBA to solve a problem from Project Euler. I am trying to answer a question that requires you to find prime numbers that can be divided by a number that does not fit in a long time. Any suggestions to fix this problem?

I know that I can divide the number between two variables, and I did it for addition and subtraction, but not division. Any help would be appreciated.

+5
source share
3 answers

You can define a decimal data type (12 bytes), but only inside the variant.

Dim i As Variant

i = CDec(i)

+2
source

bigint, char * int. , , . , .

0

Use the "Double" data type, which takes on larger values.

-2
source

All Articles