久久久久久久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'>

                          • 主站蜘蛛池模板: www.色综合| 91精品国产综合久久久久 | 日韩综合在线视频 | 在线观看涩涩视频 | 亚州一区二区三区 | 日韩久久精品 | 国产特级毛片aaaaaa喷潮 | 一区二区精品 | 午夜在线精品偷拍 | 亚洲黄色国产 | 一区二区三区av | 日本一区二区高清不卡 | 日日综合 | 久久久久久久久蜜桃 | 免费xxxx大片国产在线 | 欧美精品一区二区免费 | 欧美日韩在线视频一区二区 | 美女黄网站 | 亚洲男人网 | 99re66在线观看精品热 | 天天天天天天操 | 羞羞视频网页 | 国产成人综合在线 | 天天爱爱网 | 久久亚洲精品国产精品紫薇 | 久草中文在线 | 久久综合亚洲 | 久久国产欧美日韩精品 | 伊人欧美视频 | 日韩免费| 欧美999| 国产综合久久 | 国产午夜精品一区二区三区 | 99国产精品视频免费观看一公开 | 欧美日韩三区 | 色综合99| 在线午夜| 国产成人av在线播放 | 精品综合网 | 欧美一区2区三区3区公司 | 一区二区三区欧美在线观看 |