VBscript 中的(数字和数字) [英] (Number and Number) in VBscript

查看:25
本文介绍了VBscript 中的(数字和数字)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在经典 ASP 中有一些 VB 脚本,如下所示:

I have some VB script in classic ASP that looks like this:

if (x and y) > 0 then
    'do something
end if

它似乎是这样工作的:(46 和 1) = 0和(47 和 1) = 1

It seems to work like this: (46 and 1) = 0 and (47 and 1) = 1

我不明白这是如何工作的.有人能解释一下吗?

I don't understand how that works. Can someone explain that?

推荐答案

这是一个Bitwise AND.>

    47 is 101111
AND  1 is 000001
        = 000001

同时

    46 is 101110
AND  1 is 000001
        = 000000

这篇关于VBscript 中的(数字和数字)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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