2.solidity 数值类型 bool、uint、int、address、bytes32

2.数值类型 bool、uint、int、address、bytes32

1.布尔型 bool

布尔型是二值变量,取值为truefalse

    // 布尔型变量
    bool public _bool = true;

布尔值的运算符,包括与或非、等于不等于:

  • ! (逻辑非)
  • && (逻辑与)
  • || (逻辑或)
  • == (等于)
  • != (不等于)
    // 布尔运算
    bool public _bool1 = !_bool; //取非
    bool public _bool2 = _bool && _bool1; //与
    bool public _bool3 = _bool || _bool1; //或
    bool public _bool4 = _bool == _bool1; //相等
    bool public _bool5 = _bool != _bool1; //不相等

2.正整数 uint、整数 int

  • 用的最多的是 unit/uint256 ,无符号256位正整数
  • uint
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

海阔平

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值