牛骨文教育服务平台(让学习变的简单)
博文笔记

Assertions#assert_in_delta

创建时间:2007-06-11 投稿人: 浏览次数:722
require "test/unit"
include Test::Unit::Assertions
begin
assert_in_delta -39.30 * 100, -3930, 1e-12 #in 1e-12
rescue
print "not in 1e-12", "/n"
else
print "in 1e-12", "/n"
end
begin
assert_in_delta -39.30 * 100, -3930, 1e-13 #not in 1e-12
rescue
print "not in 1e-13", "/n"
else
print "in 1e-13", "/n"
end
 
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。