For a quick background, my math professor put up an equation on the board and said "this is the accurate equation for calculating this probability, but computers can't hold enough digits to actually calculate it. Instead, we use this approximation..."
Anyhow, I thought it silly that a computer couldn't hold enough digits, so I'm trying to make a basic calculator that can +, -, *, /, ^, and !, but it does everything using strings. By using strings, I should be able to have up to DWORD digits (4 billionish).
I need a way to add x amount of 0's to a number without having to do this:
for i=1 to x
value$=value$+"0"
next i
If x is very large, that for-next loop takes a while. It seems like there should be a better way to add 0s. I have one idea that goes something like:
string$="0"
for i=1 to x
value$=value$+string$
string$=string$+"0"
next i
This way adds more 0s faster, but there's the obvious over-count problem I'd have to account for. Any ideas?
edit: resolved
I just realized how silly it was to add 0's to the end of a decimal so I could do addition. Instead of lining up the numbers, I lined up the decimals like kindergartners do. I r moron.