久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <i id='dXnwX'><tr id='dXnwX'><dt id='dXnwX'><q id='dXnwX'><span id='dXnwX'><b id='dXnwX'><form id='dXnwX'><ins id='dXnwX'></ins><ul id='dXnwX'></ul><sub id='dXnwX'></sub></form><legend id='dXnwX'></legend><bdo id='dXnwX'><pre id='dXnwX'><center id='dXnwX'></center></pre></bdo></b><th id='dXnwX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='dXnwX'><tfoot id='dXnwX'></tfoot><dl id='dXnwX'><fieldset id='dXnwX'></fieldset></dl></div>

      <legend id='dXnwX'><style id='dXnwX'><dir id='dXnwX'><q id='dXnwX'></q></dir></style></legend>

      <small id='dXnwX'></small><noframes id='dXnwX'>

        <bdo id='dXnwX'></bdo><ul id='dXnwX'></ul>
    1. <tfoot id='dXnwX'></tfoot>

      1. 在 std::floor 之后轉換為 int 是否保證正確的結果

        Does casting to an int after std::floor guarantee the right result?(在 std::floor 之后轉換為 int 是否保證正確的結果?)

            <bdo id='ZNiiD'></bdo><ul id='ZNiiD'></ul>
              <tbody id='ZNiiD'></tbody>
                1. <i id='ZNiiD'><tr id='ZNiiD'><dt id='ZNiiD'><q id='ZNiiD'><span id='ZNiiD'><b id='ZNiiD'><form id='ZNiiD'><ins id='ZNiiD'></ins><ul id='ZNiiD'></ul><sub id='ZNiiD'></sub></form><legend id='ZNiiD'></legend><bdo id='ZNiiD'><pre id='ZNiiD'><center id='ZNiiD'></center></pre></bdo></b><th id='ZNiiD'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ZNiiD'><tfoot id='ZNiiD'></tfoot><dl id='ZNiiD'><fieldset id='ZNiiD'></fieldset></dl></div>

                2. <small id='ZNiiD'></small><noframes id='ZNiiD'>

                3. <tfoot id='ZNiiD'></tfoot>
                4. <legend id='ZNiiD'><style id='ZNiiD'><dir id='ZNiiD'><q id='ZNiiD'></q></dir></style></legend>
                  本文介紹了在 std::floor 之后轉換為 int 是否保證正確的結果?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想要一個帶有語法的 floor 函數

                  I'd like a floor function with the syntax

                  int floor(double x);
                  

                  但是 std::floor 返回一個 double.是

                  but std::floor returns a double. Is

                  static_cast <int> (std::floor(x));
                  

                  保證給我正確的整數,或者我可能有一個一對一的問題?它似乎有效,但我想確定.

                  guaranteed to give me the correct integer, or could I have an off-by-one problem? It seems to work, but I'd like to know for sure.

                  對于獎勵積分,為什么 std::floor 一開始會返回 double ?

                  For bonus points, why the heck does std::floor return a double in the first place?

                  推薦答案

                  double 的范圍遠大于 32 或 64 位整數的范圍,這就是為什么 std::floor 返回一個雙重.強制轉換為 int 應該沒問題,只要它在適當的范圍內 - 但請注意 double 不能準確表示所有 64 位整數,因此您也可以結束當您超過 double 的準確性使得兩個連續雙精度之間的差異大于 1 時,就會出現錯誤.

                  The range of double is way greater than the range of 32 or 64 bit integers, which is why std::floor returns a double. Casting to int should be fine so long as it's within the appropriate range - but be aware that a double can't represent all 64 bit integers exactly, so you may also end up with errors when you go beyond the point at which the accuracy of double is such that the difference between two consecutive doubles is greater than 1.

                  這篇關于在 std::floor 之后轉換為 int 是否保證正確的結果?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                  When and how should I use exception handling?(我應該何時以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構造函數的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區別)
                    <tbody id='GPeUI'></tbody>
                  <i id='GPeUI'><tr id='GPeUI'><dt id='GPeUI'><q id='GPeUI'><span id='GPeUI'><b id='GPeUI'><form id='GPeUI'><ins id='GPeUI'></ins><ul id='GPeUI'></ul><sub id='GPeUI'></sub></form><legend id='GPeUI'></legend><bdo id='GPeUI'><pre id='GPeUI'><center id='GPeUI'></center></pre></bdo></b><th id='GPeUI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='GPeUI'><tfoot id='GPeUI'></tfoot><dl id='GPeUI'><fieldset id='GPeUI'></fieldset></dl></div>

                    • <legend id='GPeUI'><style id='GPeUI'><dir id='GPeUI'><q id='GPeUI'></q></dir></style></legend>
                        <tfoot id='GPeUI'></tfoot>
                          <bdo id='GPeUI'></bdo><ul id='GPeUI'></ul>

                            <small id='GPeUI'></small><noframes id='GPeUI'>

                          • 主站蜘蛛池模板: 亚洲国产aⅴ精品一区二区 免费观看av | 久久人爽 | 草草草草视频 | 亚洲第一色站 | 91在线免费观看网站 | 美美女高清毛片视频免费观看 | 国产在线精品一区二区 | 别c我啊嗯国产av一毛片 | 国产精品成人一区二区三区 | 国产不卡一区在线观看 | 亚洲欧美日韩精品久久亚洲区 | 中文字幕av网站 | 国产成人短视频在线观看 | 久久精品免费 | 亚洲一区视频在线 | 91久久国产综合久久 | 一区二区三区精品视频 | 精品国产黄a∨片高清在线 成人区精品一区二区婷婷 日本一区二区视频 | 久久久精品一区二区三区 | 久久99网 | 日本三级电影在线观看视频 | 成人免费小视频 | 精品久久久久久久 | 欧美一级片在线看 | 成人精品一区亚洲午夜久久久 | 精品丝袜在线 | 野狼在线社区2017入口 | 久久精彩视频 | 北条麻妃国产九九九精品小说 | 91在线视频播放 | 久久久精品一区二区三区 | 亚洲国产aⅴ成人精品无吗 亚洲精品久久久一区二区三区 | 久久99精品久久久久久国产越南 | 精品视频国产 | 免费观看一级黄色录像 | 国产一区二区三区在线看 | 亚洲精品视频二区 | 日韩精品免费在线观看 | 青青草视频免费观看 | 99在线资源| 久久新视频 |