Programming-Idioms

History of Idiom 81

Idiom #81 Round floating point number to integer

Declare integer y and initialize it with the rounded value of floating point number x .
Ties (when the fractional part of x is exactly .5) must be rounded up (to positive infinity).

#Edit dateEdit SummaryAuthor
๐Ÿ‘ ฮ” 60 2020-08-10, 23:03 Restored version 58: Testing restoring with a reason programming-idioms.org
๐Ÿ‘ ฮ” 59 2020-08-10, 23:02 [Go] Testing restore programming-idioms.org
๐Ÿ‘ ฮ” 58 2020-06-20, 09:55 [Dart] Typo in comments programming-idioms.org
๐Ÿ‘ ฮ” 57 2020-06-20, 09:55 [Dart] Fix variable names. No sample values. Warning negative numbers. programming-idioms.org
๐Ÿ‘ ฮ” 56 2020-06-19, 03:55 New Dart implementation by user [marlonbraga] marlonbraga
๐Ÿ‘ ฮ” 55 2020-05-10, 21:36 [Elixir] 404 programming-idioms.org
๐Ÿ‘ ฮ” 54 2020-03-20, 17:51 [Rust] Avoid link shortener if possible programming-idioms.org
๐Ÿ‘ ฮ” 53 2019-12-28, 21:13 [Scheme] Emphasize variable x programming-idioms.org
๐Ÿ‘ ฮ” 52 2019-12-24, 03:29 New Scheme implementation by user [Gene_Parmesan] Gene_Parmesan
๐Ÿ‘ ฮ” 51 2019-10-14, 12:27 [Elixir] Dead link: play.elixirbyexample.com has been down for a while programming-idioms.org
๐Ÿ‘ ฮ” 50 2019-09-27, 14:29 New Fortran implementation by user [tkoenig] tkoenig
๐Ÿ‘ ฮ” 49 2019-09-26, 18:53 New Csharp implementation by user [test] test
๐Ÿ‘ ฮ” 48 2018-04-23, 23:18 [Haskell] Revert bug (think x=0.3) programming-idioms.org
๐Ÿ‘ ฮ” 47 2018-04-17, 23:42 [Ruby] comment steenslag
๐Ÿ‘ ฮ” 46 2018-04-17, 17:13 [Haskell] It says "round up on 5" hrschueler
๐Ÿ‘ ฮ” 45 2018-04-08, 06:49 [Python] formatting bukzor
๐Ÿ‘ ฮ” 44 2018-04-08, 06:49 New Python implementation by user [bukzor] bukzor
๐Ÿ‘ ฮ” 43 2018-01-27, 12:38 Admin deletes impl 1827 programming-idioms.org
๐Ÿ‘ ฮ” 42 2018-01-26, 19:55 [Python] Fix rounding up/down. Jeff%20S
๐Ÿ‘ ฮ” 41 2017-12-08, 14:17 [Lua] shorter lukems
๐Ÿ‘ ฮ” 40 2017-12-08, 14:15 New Lua implementation by user [lukems] lukems
๐Ÿ‘ ฮ” 39 2017-10-18, 23:06 [Ruby] "round" rounds away from zero steenslag
๐Ÿ‘ ฮ” 38 2017-10-16, 09:35 New JS implementation by user [programming-idioms.org] programming-idioms.org
๐Ÿ‘ ฮ” 37 2017-08-21, 12:16 New Lua implementation by user [Bug38] Bug38
๐Ÿ‘ ฮ” 36 2016-12-06, 14:43 [Go] +DocURL programming-idioms.org
๐Ÿ‘ ฮ” 35 2016-11-30, 22:50 [Elixir] +DemoURL. +Warning programming-idioms.org
๐Ÿ‘ ฮ” 34 2016-11-27, 14:58 [Python] Whitespace programming-idioms.org
๐Ÿ‘ ฮ” 33 2016-11-13, 14:48 [Ruby] 2 ways => 2 impls. +DemoURL. +BUG warning. programming-idioms.org
๐Ÿ‘ ฮ” 32 2016-09-18, 15:33 New Python implementation by user [Kevogich] programming-idioms.org
๐Ÿ‘ ฮ” 31 2016-09-18, 15:33 New Python implementation by user [Kevogich] Kevogich
๐Ÿ‘ ฮ” 30 2016-09-14, 08:32 New Elixir implementation by user [NobbZ] NobbZ
๐Ÿ‘ ฮ” 29 2016-08-11, 20:36 New Rust implementation by user [Reiner Martin] Reiner Martin
๐Ÿ‘ ฮ” 28 2016-04-21, 11:03 New Perl implementation by user [Roboticus] Roboticus
๐Ÿ‘ ฮ” 27 2016-03-04, 21:50 [PHP] cast to int
๐Ÿ‘ ฮ” 26 2016-03-04, 13:46 New PHP implementation by user [AgillaDev]
๐Ÿ‘ ฮ” 25 2016-02-18, 18:22 New Cpp implementation by user [XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
๐Ÿ‘ ฮ” 24 2016-02-18, 18:19 New C implementation by user [Dอฬ†อ‹อฏอชฬ…อฆองฬ’ฬ…ฬ”องฬอŒอƒอฏฬ…ฬพอฏฬตอขฬ›ฬขฬบฬฆฬฬปฬฎฬŸฬคฬฅฬ˜ฬฌฬฐฬฎOอ—อŒอฆอฃอฎฬฬšฬƒอฎ...
๐Ÿ‘ ฮ” 23 2016-02-18, 18:19 New C implementation by user [Dอฬ†อ‹อฏอชฬ…อฆองฬ’ฬ…ฬ”องฬอŒอƒอฏฬ…ฬพอฏฬตอขฬ›ฬขฬบฬฆฬฬปฬฎฬŸฬคฬฅฬ˜ฬฌฬฐฬฎOอ—อŒอฆอฃอฎฬฬšฬƒอฎ...
๐Ÿ‘ ฮ” 22 2016-02-18, 16:58 New Pascal implementation by user [Bart]
๐Ÿ‘ ฮ” 21 2016-02-18, 09:18 New Python implementation by user [TinyFawks]
๐Ÿ‘ ฮ” 20 2016-01-15, 15:42 New Pascal implementation by user [Bart]
๐Ÿ‘ ฮ” 19 2016-01-03, 13:35 [Go] Proper import
๐Ÿ‘ ฮ” 18 2016-01-03, 13:31 [Go] Proper import
๐Ÿ‘ ฮ” 17 2016-01-03, 13:25 [Go] Proper import
๐Ÿ‘ ฮ” 16 2016-01-03, 13:22 [Go] Proper import
๐Ÿ‘ ฮ” 15 2016-01-02, 18:51 .5 emphasis fix
๐Ÿ‘ ฮ” 14 2016-01-02, 14:58 New Go implementation by user [mem]
๐Ÿ‘ ฮ” 13 2015-11-30, 12:37
๐Ÿ‘ ฮ” 12 2015-10-29, 14:05
๐Ÿ‘ ฮ” 11 2015-09-17, 06:05
๐Ÿ‘ ฮ” 10 2015-09-14, 19:18
๐Ÿ‘ ฮ” 9 2015-09-05, 17:12
๐Ÿ‘ ฮ” 8 2015-09-05, 17:12
๐Ÿ‘ ฮ” 7 2015-09-05, 17:10
๐Ÿ‘ ฮ” 6 2015-09-05, 14:01
๐Ÿ‘ ฮ” 5 2015-09-04, 10:52
๐Ÿ‘ ฮ” 4 2015-09-03, 15:52
๐Ÿ‘ ฮ” 3 2015-09-01, 21:32
๐Ÿ‘ ฮ” 2 2015-09-01, 21:32
1 2015-09-01, 21:31