I want to be able to turn any large digit multiplication into a complete string of numbers (without scientific notation), for example if I multiplied a 15 digit number by itself it’d become 28 digits long, and I want all of those 28 digits to show.
I tried splitting the number I’m multiplying into it’s individual parts and putting those parts into an array, and then multiplying that number by the other number…
My problem is adding them together and getting the correct number.
For example, let’s do a small multiplication.
1 2 * 12
How this would work:
1 x 12 = 12
2 * 12 = 24
Now the problem is when I actually have to add the strings together.
When I work with large strings that go past the integer limit I can’t just add them together, that’d ruin the purpose of this whole post.
Instead I need to carry over each number to the next child.
So I’ll use SubStr()
to take the digits over the last digit if the length of the child is more than one and add it to the next, and then continue doing that until all children are only one digit long, then I should add all of the numbers together into one string, so let’s say I did 1 2 x 12…
1 x 12 = 12
2 * 12 = 24
Let’s say I had 5 children in the array for an example.
I make the number backwards in order so the total digits can go up.
Children:
1: 4
2: 4
3: 1
Now I add the children together into a string backwards using a for all children event.
If the child is > or = 1 add Array[5-ChildName].
After repeating 5 times I get 00144 (without the zeroes, of course, that’s just a representation).
Now this is great and all.
And this does work, except there’s a couple things I haven’t mentioned.
The number that you will be splitting will always be up to 15 digits long.
The number that will be multiplied with the children CAN be more than the integer limit, which means the number has to be split into sections as well (preferably also 15 digits max).
This is all a little mind-boggling, I don’t really know how to execute this well.
if someone could give me a little demonstration it’d help a lot.
PS: Another thing I tried experimenting with was the repeat event, and I could carry over the digits more easily after every repetition, although, it doesn’t work very well considering you can’t repeat half a time to get a 1/2 multiplication, and the addition is a little wonky and when I was testing it, it was adding one extra time than needed, but even if I did do repeat (amount-1) times, it’d not always be proper.
I’m becoming a little depressed with all this failure.