乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      JS整數(shù)與浮點(diǎn)數(shù)的轉(zhuǎn)換

       moyqsky 2010-12-28

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www./TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www./1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>整數(shù)與浮點(diǎn)數(shù)的轉(zhuǎn)換</title>
      </head>

      <body>
      <script language="javascript" type="text/javascript">
       document.write("整數(shù)轉(zhuǎn)換函數(shù):parseInt(數(shù)據(jù),底數(shù))<br>");
       document.write("10101=>" + parseInt("10101",2)+"<br>");
       document.write("77=>" + parseInt("77",8)+"<br>");
       document.write("2A3B=>" + parseInt("2A3B",16)+"<br>");
       document.write("077=>" + parseInt("077")+"<br>");
       document.write("0X2A3B=>" + parseInt("0X2A3B")+"<br>");
       document.write("浮點(diǎn)數(shù)轉(zhuǎn)換函數(shù):parseFloat(數(shù)據(jù))<br>");
       var str  = "12.345";
       var str1 = str + 6;
       var str2  = parseFloat(str) + 6;
       document.write(str1 + "=>" + parseFloat(str1)+"<br>");
       document.write(str1 + "=>" + parseFloat(str2)+"<br>");
       document.write("34.89a23=>" + parseFloat("34.89a23")+"<br>");
       document.write("數(shù)字判斷函數(shù):isNaN<br>");
       document.write("4是數(shù)字:"+!isNaN(4)+"<br>");
       document.write("ffff是數(shù)字:"+!isNaN("ffff")+"<br>");
      </script>
      </body>
      </html>

      輸出:

      整數(shù)轉(zhuǎn)換函數(shù):parseInt(數(shù)據(jù),底數(shù))
      10101=>21
      77=>63
      2A3B=>10811
      077=>63
      0X2A3B=>10811
      浮點(diǎn)數(shù)轉(zhuǎn)換函數(shù):parseFloat(數(shù)據(jù))
      12.3456=>12.3456
      12.3456=>18.345
      34.89a23=>34.89
      數(shù)字判斷函數(shù):isNaN
      4是數(shù)字:true
      ffff是數(shù)字:false

        本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多