{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/23150","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/23150/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/23150/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/23150/events","html_url":"https://github.com/rust-lang/rust/issues/23150","id":60215323,"number":23150,"title":"f64 formatting panic with 'arithmetic operation overflowed'","user":{"login":"Gekkio","id":94033,"avatar_url":"https://avatars.githubusercontent.com/u/94033?v=3","gravatar_id":"","url":"https://api.github.com/users/Gekkio","html_url":"https://github.com/Gekkio","followers_url":"https://api.github.com/users/Gekkio/followers","following_url":"https://api.github.com/users/Gekkio/following{/other_user}","gists_url":"https://api.github.com/users/Gekkio/gists{/gist_id}","starred_url":"https://api.github.com/users/Gekkio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gekkio/subscriptions","organizations_url":"https://api.github.com/users/Gekkio/orgs","repos_url":"https://api.github.com/users/Gekkio/repos","events_url":"https://api.github.com/users/Gekkio/events{/privacy}","received_events_url":"https://api.github.com/users/Gekkio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-07T17:19:15Z","updated_at":"2015-03-07T17:19:15Z","closed_at":null,"body":"Here's a minimal example which results in a runtime error:\r\n```rust\r\nfn main() {\r\n    println!(\"{:.0}\", 9.9);\r\n}\r\n```\r\n\r\nI'd expect that format string to work (precision=0, so no digits after the decimal point), but here's what I get with RUST_BACKTRACE=1:\r\n\r\n```\r\nthread '<main>' panicked at 'arithmetic operation overflowed', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libcore/fmt/float.rs:245\r\nstack backtrace:\r\n   1:     0x7f92f7b9381f - sys::backtrace::write::h2f046b875b210aadOBA\r\n   2:     0x7f92f7b97db2 - panicking::on_panic::h792ac47fb8c07faehHJ\r\n   3:     0x7f92f7b8dd6a - rt::unwind::begin_unwind_inner::hbffac672008352c8knJ\r\n   4:     0x7f92f7b8e481 - rt::unwind::begin_unwind_fmt::hbe64affaa986f482VlJ\r\n   5:     0x7f92f7b976d7 - rust_begin_unwind\r\n   6:     0x7f92f7bc1f64 - panicking::panic_fmt::h81cd96819f02da8dIZs\r\n   7:     0x7f92f7bc1e8d - panicking::panic::h8ea414638b29b322UXs\r\n   8:     0x7f92f7bc6066 - fmt::f64.Display::fmt::hb0a5033b26a63c76UzD\r\n   9:     0x7f92f7bc5071 - fmt::write::h3770d88fab3d43d6YXC\r\n  10:     0x7f92f7bc4d78 - fmt::Arguments<'a>.Debug::fmt::h542db8d18a17ace0xVC\r\n  11:     0x7f92f7bc5110 - fmt::write::h3770d88fab3d43d6YXC\r\n  12:     0x7f92f7b9130c - old_io::Writer::write_fmt::h7179537900110901984\r\n  13:     0x7f92f7b92275 - old_io::stdio::println_args::hee7144bbc1e28d79dNg\r\n  14:     0x7f92f7b8d6e8 - main::h35109694ee10d661eaa\r\n  15:     0x7f92f7b9c1c8 - rust_try_inner\r\n  16:     0x7f92f7b9c1b5 - rust_try\r\n  17:     0x7f92f7b9978c - rt::lang_start::h3d4a7f7be4f6d99bxBJ\r\n  18:     0x7f92f7b8d74e - main\r\n  19:     0x7f92f6d7dec4 - __libc_start_main\r\n  20:     0x7f92f7b8d4f8 - <unknown>\r\n  21:                0x0 - <unknown>\r\n```\r\n\r\nUbuntu 14.10 / 64-bit\r\nrustc 1.0.0-nightly (b0746ff19 2015-03-05) (built 2015-03-06)\r\nbinary: rustc\r\ncommit-hash: b0746ff19b3bc204215f04bbb5756159f9bc5c92\r\ncommit-date: 2015-03-05\r\nbuild-date: 2015-03-06\r\nhost: x86_64-unknown-linux-gnu\r\nrelease: 1.0.0-nightly"}}