You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
否则,定义 n,k 以及 s 为符合 k ≥ 1, 10k - 1 ≤ s < 10k 条件的整数,R(s) x 10RR(n) - R(k) 的 Number值 是 x,同时 k 应尽可能的小。请注意,k 是 s 的十进制表示形式的位数,s 不能被 10R 整除,并且 s 的最低有效位不一定由这些条件唯一确定。
js数据类型:Number(二)
Number::unit 形式运算算法 续
Number::subtract( x, y ) 减法
x - y 等同于 x + (-y)
Number::leftShift( x, y ) 左移
Number::signedRightShift( x, y ) 有符号右移
Number::unsignedRightShift( x, y ) 无符号右移
Number::lessThan( x, y ) 小于
Number::equal( x, y ) 等于
Number::sameValue( x, y ) 相同值
Number::sameValueZero( x, y )
NumberBitwiseOp( op, x, y )
Number::bitwiseAND( x, y ) 与
Number::bitwiseXOR( x, y ) 异或
Number::bitwiseOR( x, y ) 或
Number::toString( x )
思考
toString为何要这样写?
这个其实和浮点数有点关系。js是支持浮点数的,举个例子,浮点数
1.1
,这里的小数点表示 我是个浮点数,所以一般来说,直接像上面那样采用字面量形式来写的话,需要区分浮点数!即
1.toString()
这种写法,js引擎会默认1.
这个是浮点数,所以改成1..toString()
则避免了这种歧义。当然,用括号括起来语义上看起来更清晰。The text was updated successfully, but these errors were encountered: