0" produces an integer?

This question already has an answer here:

  • Using bitwise OR 0 to floor a number 5 answers

  • The operands of bitwise operations are always converted to signed 32-bit integers in big-endian order and in two's complement format.

    That would be

        00000000000000000000000000000101
    or  00000000000000000000000000000000
    ------------------------------------ 
        00000000000000000000000000000101
    

    The bitwise operators in Javascript automatically coerce their arguments to 32-bit integer values by dropping the fraction and any high-order bits beyond 32. So

    5.55 | 0
    

    is treated like:

    5 | 0
    
    链接地址: http://www.djcxy.com/p/77440.html

    上一篇: 0)语句在javascript中给出了一个整数

    下一篇: 0“产生一个整数?