That's a good idea, thank you. It seems to work quite nicely up to a point, as in, 34 digits. But after that, it appears to start rounding.. but it's a great proof of concept. I'll tweak it a bit and get it to do right (using a while loop, of course). Thanks for your help, it's very much appreciated.

EDIT: One issue with this approach is how it handles zeros when they're at the start of a 17-character "block". I'm currently making a way to work around this, though, and I'll post what I come up with in here when I think I'm done in case anyone else wants the script.

EDIT AGAIN: Here's the code I came up with. It seems to perform well under my tests.. I haven't found a flaw with it. At least with division, which is all I tested it with. [EDIT: it only works with division..][Another EDIT: it has a flaw involving ones at the start of 17-character blocks.] I'm also including an identifier I wrote, since it makes the script itself look much more.. clean, without having to do that in the main script.

Code:
alias Lcalc {
  ;SYNTAX: $Lcalc(number,operator,smallernumber)
  ;Example, $Lcalc(64,/,2) returns 32.
  if ($len($3) < 17) {
    var %step = 1
    while ($mid($1,$calc((%step - 1) * 17)) != $null) { var %cur = $mid($1,$calc((%step - 1) * 17 + 1),17) | if ((!$remove(%cur,0)) && ($len(%cur > 1))) { var %lcalc.b = %cur } | else { var %lcalc.b = %cur $2 $3 | var %lcalc.b = $str(0,$countleft(%cur,0)) $+ %lcalc.b } | var %lcalc.t = %lcalc.t $+ %lcalc.b | inc %step }
    return %lcalc.t
  }
}
alias countleft {
  ;SYNTAX: $countleft(text,character)
  ;The number of "character" on the left side of text is counted and returned.
  ;Example: $countleft(hhhithere,h) would return 3.
  ;You can put a - next to 'character' to count from the right. Example, $countleft(hhhithere,-e) would return 1.
  var %step = 1 , %ident = $iif($left($2,1) == -,$iif($len($2) == 2,right),left) $+ $chr(40) $+ z $+ $chr(41) , %2 = $iif($len($2) == 2,$right($2,1),$left($2,1))
  while ($ [ $+ [ $replace(%ident,z,$1 $+ $chr(44) $+ %step) ] ] == $str(%2,%step)) inc %step
  return $calc(%step - 1)
}


Note I changed it from Pcalc to Lcalc, to avoid confusion and because "loop" starts with "L".


Since the script appears full of holes, anyone who wants to try to fix it (or provide their own script as a replacement) can feel free. :P
Thank you.

Last edited by ZorgonX; 07/09/07 10:53 PM.