<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 小心地測試浮點數的相等性 在計算中過度相信 IEEE 浮點數是一種錯誤。例如: ~~~ print "---\n"; print "A: ", 2.4, "\n"; print "B: ", 0.2*12, "\n"; if ( 0.2*12 == 2.4 ) { print "These are equal.\n"; } else { print "These are not equal.\n"; } A: 2.4 B: 2.4 These are not equal. ~~~ 這樣的結果是由于這個事實:?_0.2_?(1/5) 在 IEEE 空間無法被表示為二進制分數。 因此,如果你想要檢查浮點數的相等性,那么可以使用?`sprintf`?或類似 的東東。 參閱?[http://perldoc.perl.org/perlfaq4.html](http://perldoc.perl.org/perlfaq4.html)?了解細節。 ## 數字舍入 不要使用?`int()`?來做數字舍入,它只會返回整數部分。`sprintf()`?或?`printf()`?一般夠用了。 ~~~ printf("%.3f", 3.1415926535); # prints 3.142 ~~~ 如果你需要向下或向上舍入,那么可以使用?[POSIX](https://metacpan.org/module/POSIX)?模塊所提供的?`ceil()`?和?`floor()`函數。其中,`ceil()`?是向上舍入,而?`floor()`?是向下舍入。 ~~~ use POSIX; my $ceil = ceil(3.5); # 4 my $floor = floor(3.5); # 3 ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看