JavaScript 乘法運(yùn)算
■實(shí)例設(shè)計(jì)
特殊操作數(shù)的乘法運(yùn)算。
var n = 5; //定義并初始化任意—個(gè)數(shù)值
console.log (NaN * n); //NaN與任意摔作數(shù)相乘,結(jié)果都是NaN
console.log (Infinity * n); //Infinity 與任意非0正數(shù)相乘,結(jié)果都是 Infinity
console.log (Infinity * ( - n)); //Irlfi'nity 與任意非0負(fù)數(shù)相乘,結(jié)果都是-Infinity.
console.log (Infinity * 0); //Infinity 與0相乘,結(jié)果是 NaN
console.log (Infinity * Infinity) //Infinity 與 Infinity相乘,結(jié)果是Infinity
點(diǎn)擊加載更多評(píng)論>>