提交 b505504d 编写于 作者: C Cody Schroeder

Add test for float::round

上级 02e907b6
......@@ -581,6 +581,15 @@ pub fn test_to_str_inf() {
assert to_str(-infinity, 10u) == ~"-inf";
}
#[test]
pub fn test_round() {
assert round(5.8) == 6.0;
assert round(5.2) == 5.0;
assert round(3.0) == 3.0;
assert round(2.5) == 3.0;
assert round(-3.5) == -4.0;
}
#[test]
pub fn test_traits() {
fn test<U:num::Num cmp::Eq>(ten: &U) {
......@@ -609,8 +618,3 @@ fn test<U:num::Num cmp::Eq>(ten: &U) {
// buffer-file-coding-system: utf-8-unix
// End:
//
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册