Since none I could find worked the way I wanted them to, I decided to write my own version, with input an output as I like them to be.
They work under 2K/XP (no Dos/Win9x/Me sorry).
Enjoy.
jaclaz
Posted 04 September 2007 - 09:20 PM
Posted 05 October 2007 - 10:42 AM
W:\OFS\TOOLS>multiply 1024*1024
1048576
W:\OFS\TOOLS>multiply 1,024*1024
1,048,576
W:\OFS\TOOLS>multiply 1.024*1024
1.048.576
W:\OFS\TOOLS>multiply 1.024*1048576
1.073.741.824
W:\OFS\TOOLS>multiply 1.024*1.073.741.824
1.099.511.627.776
W:\OFS\TOOLS>multiply 1024*1024§
1§048§576
Posted 12 October 2007 - 04:10 PM
Jaclaz,Another pretty much useless batch
, multiply.cmd.
The batch language can do Integer Math quite well, though all operations have a limit fixed to hex 7FFFFFF i.e. 2147483647 decimal.
Multiply.cmd takes two numbers and multiplies them, with precision up to 15 digits:
The first non numeric character found (exception made for "*") is interpreted as the thousands separator:
jaclaz
Posted 14 October 2007 - 10:55 AM
Jaclaz,
You are great![]()
Until now I did not even have had the opinion, that somethig like this is possible by simple *.cmd!
Peter
Posted 01 December 2008 - 11:26 AM
Posted 29 March 2010 - 09:46 AM
Posted 01 September 2011 - 01:39 PM
@ECHO OFF SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION ::======================================================== ::| WARNING! Limit is 2147483647 i.e. 7FFFFFF WARNING! | ::======================================================== :: dec2hex.cmd :: a simple and nice way to convert decimal numbers to hex numbers :: by jaclaz, thanks to "SmartGenius" findings on Dynamic Environment Variables :: and to Rob Van der Woude: http://www.robvanderwoude.com/ntset.php :input_loop SET Input_dec=NOTHING SET /P Input_dec=Input a positive decimal number smaller than 2147483648 : IF "%Input_dec%"=="NOTHING" GOTO :input_loop IF %Input_dec% geq 2147483647 ECHO WAAAAY TOO BIG....&GOTO :input_loop CALL :dec2hex VAR %Input_dec% SET VAR_ ECHO :check ECHO SET /A VAR=%VAR% SET /A VAR=%VAR% SET VAR GOTO :EOF :dec2hex ECHO %0 CMD /C EXIT /B %2 SET "%1=%=ExitCode%" SET %1=0x!%1! SET %1__full=!%1! SET %1_byte=0x!%1:~-2! SET %1_word=0x!%1:~-4! GOTO :EOF
@ECHO OFF SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION ::======================================================== ::| WARNING! Limit is 2147483647 i.e. 7FFFFFF WARNING! | ::======================================================== :: chrs.cmd :: a simple and nice way to convert decimal numbers to ASCII characters :: by jaclaz, thanks to "SmartGenius" findings on Dynamic Environment Variables :: and to Rob Van der Woude: http://www.robvanderwoude.com/ntset.php :input_loop SET Input_dec=NOTHING SET /P Input_dec=Input a positive decimal number smaller than 256: IF "%Input_dec%"=="NOTHING" GOTO :input_loop IF %Input_dec% geq 256 ECHO WAAAAY TOO BIG....&GOTO :input_loop CALL :getchar VAR %Input_dec% ECHO %Input_dec% is ASCII character %VAR% GOTO :EOF :getchar ECHO %0 CMD /C EXIT /B %2 SET "%1=%=ExitCodeAscii%" GOTO :EOF
@ECHO OFF SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION :: asciitable.cmd :: a simple and nice way to print an ASCII table of characters :: (only "ECHOable" characters) :: by jaclaz, thanks to "SmartGenius" findings on Dynamic Environment Variables :: and to Rob Van der Woude: http://www.robvanderwoude.com/ntset.php FOR /L %%A IN (32,1,126) DO ( CALL :getchar %%A ) GOTO :EOF :getchar CMD /C EXIT /B %1 SET "Line=%=ExitCode%" SET /A Line_Dec=0x%Line% SET "Line_hex=0x%Line:~-2% SET "Line_char=%=ExitCodeAscii%" ECHO %Line_dec% %Line_hex% "( %Line_char% )" GOTO :EOF
0 members, 0 guests, 0 anonymous users