If you need to calculate with extremely long numbers, up to 65520 base 10 digits,
download LONGCALC.EXE and place it in a folder that is in your path.
LONGCALC.EXE supports the following operators:
nop tix mls err all stk cls var wln wrs clq tab rdd rze rnd val str neg abs dup inc wrt dec pop srt fac len wts wns shl shr min max cmp mag add and xor oar not imp mul div sub mod swp pow oik dig kio def fed cat exe sbs for if0 no0 ifl nol ifg nog whl ncr hcf lcm #f9 #fn #pi #sd #ds #sm #ms #dw #ws #uf #sa #dt #us #dd #dy #ge #eg ctu INS OUT KEY SCR bas try pip gnv pnv edp cof con hltTo find out what each operator does:
1. Open a CMD.EXE window.
2. Type LONGCALC and press Enter.
3. Type ?XXX and press Enter, where XXX is an operator.
4. To exit LONGCALC, type hlt and press Enter.
To use LONGCALC.EXE to divide 7,768,489,957,892,578,474,792,094 by 12,280, type:
LONGCALC 7,768,489,957,892,578,474,792,094 12,280 div wrt
The following is displayed:
LONGCALC: www.merlyn.demon.co.uk >= 2005-07-22 compiled with Borland Pascal MSDOS mode. +632,613,188,753,467,302,507NOTE: LONGCALC.EXE is extremely slow, and should only be used when other methods, like DoMath, won't work.
I have scripted BigCALC.bat to allow you to calculate in a batch.
The syntax for using BigCALC.bat is:
call BigCALC Num1 \[Num2\] OPR ANS
Where:
Num1 is the first number. If it contains commas, it must be quoted. Num2 is the second number, if required by the operator. If it contains commas, it must be quoted. OPR is an operator. ANS is a call directed environment variable that will contain the answer.
Example
If you wanted to calculate the square root of 4 times 4 and return the result in environment variable ANS, your batch would contain:@echo off call BigCALC 4 4 mul prod call BigCALC "%prod%" srt ANS @echo %ANS%BigCALC.bat contains:
@echo off if \{%4\}\{\} @echo Syntax: BigCALC Num1 \[Num2\] OPR ANS&goto :EOF setlocal set out="%TEMP%\BigCALC_%RANDOM%.TMP" set num1=%1 set num1=%num1:"=% if \{%4\}
\{\} goto C1 set num2=%2 set num2=%num2:"=% LONGCALC %num1% %num2% %3 wrt>%out% LONGCALC hlt >nul for /f "Skip=3 Tokens=*" %%n in ('type %out%^|find /V "RPN"') do ( set ANS=%%n ) del /q %out% endlocal&set %4=%ANS% goto :EOF :C1 LONGCALC %num1% %2 wrt>%out% LONGCALC hlt >nul for /f "Skip=3 Tokens=*" %%n in ('type %out%^|find /V "RPN"') do ( set ANS=%%n ) del /q %out% endlocal&set %3=%ANS%
0 comments
Hide comments