We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d2e1bfb + b505504 commit 3e9c95eCopy full SHA for 3e9c95e
src/libcore/float.rs
@@ -581,6 +581,15 @@ pub fn test_to_str_inf() {
581
assert to_str(-infinity, 10u) == ~"-inf";
582
}
583
584
+#[test]
585
+pub fn test_round() {
586
+ assert round(5.8) == 6.0;
587
+ assert round(5.2) == 5.0;
588
+ assert round(3.0) == 3.0;
589
+ assert round(2.5) == 3.0;
590
+ assert round(-3.5) == -4.0;
591
+}
592
+
593
#[test]
594
pub fn test_traits() {
595
fn test<U:num::Num cmp::Eq>(ten: &U) {
@@ -609,8 +618,3 @@ pub fn test_traits() {
609
618
// buffer-file-coding-system: utf-8-unix
610
619
// End:
611
620
//
612
-
613
614
615
616
0 commit comments