function f(){ var i=0; if(typeof(i)=="number") { var f=Math.floor(i); if(f==i) alert("整型"); else alert("浮点型"); } }