Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::---------------------------------------------------------------------------------------
- :: square a number
- ::
- :: call :pow 12 2 RETURNVAR
- :: echo %RETURNVAR%
- ::---------------------------------------------------------------------------------------
- :pow
- setlocal
- set "out=1"
- for /l %%a in (1,1,%2) do set /a "out*=%1"
- if %~1 equ 0 set "out=1"
- (endlocal
- if "%~3" neq "" ( set "%~3=%out%" ) else echo %out%
- )
- goto :eof
- ::---------------------------------------------------------------------------------------
Add Comment
Please, Sign In to add comment