Floating point division in a batch file

后端 未结 8 899
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-27 21:48

I need to do a floating-point division in a dos batch.

I didn\'t find a way to do it. Something like this :

SET /A Res=10/3

returns

8条回答
  •  温柔的废话
    2020-11-27 22:21

    If you're running in a command shell on Windows (rather than DOS), you can use VBScript to evaluate complex expressions including floating point math for you.

    I have written a small helper library you can call to do this.

    EvalBat Library on GitHub

提交回复
热议问题