Jump to content

rabit

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by rabit

  1. I know the limitations. now it seems i can not avoid the precision/rounding problem by cutting a digit from left (highest) to an array element. then do you know a way to show all digits of a large number, for example, 2^100? thanks!
  2. sorry, I can not understand what did you mean by "there's an edit key". I edited the script with UltraEdit.
  3. sounds possible. I then changed $d = $x^2 to $d = $x*$x. however, another result appeared (see attachement).
  4. but if $x = 100000002, both results are right.
  5. if $x is changed to 10012547593376, the result attached still showed this error.
  6. and here is the result of the script. still can not figure out why.
  7. can anyone help? I need to know every digit of a number which is larger than 10^15 and which could not be shown by calculator or AutoIt3. So I use an array for storing each digit and then for showing all the elements of the array. but I found one thing hard to understand. For $x = 100000001 but not other some numbers, why are the calculation results of $x^2 different, of which the latter is obviously right? Below is the script I wrote. ==================================== $x = 100000001 $d = $x^2 $t= Int(Log($d)/Log(10)) dim $array[$t+1] $out = "" For $i = 0 To $t $array[$i] = Int($d/10^($t-$i)) $out = $out & $array[$i] $d = $d - Int($d/10^($t-$i))*10^($t-$i) Next Run("calc.exe") WinWaitActive("Calculator") AutoItSetOption("SendKeyDelay", 200) ClipPut($x) Send("^v") Send("*") Send("^v") Send("=") Send("^c") ;Send("100000001*100000001=") $out2 = ClipGet() WinClose("Calculator") WinWaitClose("Calculator") msgbox(0,"Comparison","by array: " & @CRLF &_ " " & $x & "^2=" & $out & @CRLF &_ @CRLF & @CRLF &_ "by calculator: " & @CRLF &_ " " & $x & "^2=" & $out2)
×
×
  • Create New...