这样 大数乘法似乎效率可以高点了
论坛上 乘法的运算应该有了
如版主认为 重复贴 可删除- @echo off&setlocal enabledelayedexpansion
- set X=33478071698956898786044169848212690817704794983713768568912431388982883793878002287614711652531743087737814467999489
- set Y=36746043666799590428244633799627952632279158164343087642676032283815739666511279233373417143396810270092798736308917
- for %%i in (X Y) do (
- set $%%i=000!%%i!&set S=!$%%i!&set #%%i=1
- for %%j in (4096 2048 1024 512 256 128 64 32 16 8 4 2 1)do if "!S:~%%j!" neq "" set/a #%%i+=%%j&set "S=!S:~%%j!"
- )
- set j=0000
- for /l %%i in (4 4 %#X%) do (
- for /f "tokens=* delims=0" %%a in ("!$x:~-%%i,4!") do (
- if "%%a" neq "" (
- set s=&set i=0000
- for /l %%j in (4 4 %#Y%) do (
- for /f "tokens=* delims=0" %%b in ("!$y:~-%%j,4!") do (
- if "%%b" neq "" (
- set /a i=%%a*%%b+1!i:~-4!+1!j:~-%%j,4!+0x5F592E0
- ) else set/a i=1!i:~-4!+1!j:~-%%j,4!+0x5F592E0
- )
- set s=!i:~-4!!s!&set i=!i:~,-4!
- )
- set j=!i!!s!
- )
- set str=!j:~-4!!str!
- set j=%j%!j:~1,-4!
- )
- )
- for /f "tokens=* delims=0" %%i in ("!j!!str!") do echo %%i
- pause
复制代码
|