08小于1,但07大于1中的DOS /批次。为什么? [英] 08 is less than 1, but 07 is greater than 1 in DOS/Batch. Why?

查看:118
本文介绍了08小于1,但07大于1中的DOS /批次。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在DOS /批次,

if 08 lss 1 echo true

呼应真。这同样适用于09两者08和09都小于1。

echoes "true". The same applies to 09. Both 08 and 09 are less than 1.

然而,

if 07 lss 1 echo true

没有任何回音。 01至07是不小于1的

does not echo anything. 01 to 07 are not less than 1.

为什么呢?特别之处是08和09?

Why? What is special about 08 and 09?

推荐答案

通常情况下,一个领先的 0 表示您想在的八​​进制。我期望 08 09 实际上是一个的错误条件的;或许是批处理语言没有一个很好的机制,以表明输入是不正确的?

Typically, a leading 0 indicates you'd like the number to be parsed in octal. I'd expect 08 or 09 to actually be an error condition; perhaps the batch language does not have a good mechanism to signify that the input was incorrect?

这篇关于08小于1,但07大于1中的DOS /批次。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆