decimals in batch script

前端 未结 2 462
误落风尘
误落风尘 2020-12-19 14:12
echo off
cls

mode con: cols=55 lines=15

:MAIN
color 07
cls

set /p num1=\"Specify first number: \"
cls
set /p num2=\"Specify second number: \"
cls

set /a num3=%nu         


        
2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-19 14:33

    Batch does not support floating point arithmetic. You have to rely on external scripts.

    http://www.computing.net/howtos/show/batch-script-floating-point-math/753.html

    Floating point division in a dos batch

提交回复
热议问题