KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
GNU bash, version 4.2.24: $> printf "%.0f, %.0f\n" 48.5 49.5 48, 50 Ruby 1.8.7 > printf( "%.0f, %.0f\n", 48.5, 49.5 ) 48, 50 Perl 5.12.4 $> perl -e 'printf( "%.0f, %.0f\n", 48.5, 49.5 )' 48, 50 gcc 4.5.3: > printf( "%.0f, %.0f\n", 48.5, 49.5 ); 48, 50 GHC, version 7.0.4: > printf "%.0f, %.0f\n" 48.5 49.5 49, 50 Wikipedia says that this kind of rounding is called round half to even : This is the default rounding mode used in IEEE 754 computing functions and operators. Why is this rounding used by default in C, Perl, Ruby and bash, but not in Haskell? Is it some sort of tradition or standard? And if it is a standard, why it's used by those languages and not used by Haskell? What is a point of rounding half to even?
Tags (comma-separated)
Save Edits
Cancel