⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 04__functions.t

📁 SinFP是一种新的识别对方计算机操作系统类型的工具
💻 T
字号:
#!perl -wuse strict;no strict "vars";use Bit::Vector;# ======================================================================#   $set->Norm();#   $set->Min();#   $set->Max();# ======================================================================print "1..21\n";$lim = 997;$set = new Bit::Vector($lim);$norm = $set->Norm();$min = $set->Min();$max = $set->Max();$n = 1;if ($norm == 0){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($min > $lim){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($max < -$lim){print "ok $n\n";} else {print "not ok $n\n";}$n++;$set->Fill();$norm = $set->Norm();$min = $set->Min();$max = $set->Max();if ($norm == $lim){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($min == 0){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($max == $lim-1){print "ok $n\n";} else {print "not ok $n\n";}$n++;$set->Empty();$set->Bit_On(0);$set->Bit_On($lim-1);$norm = $set->Norm();$min = $set->Min();$max = $set->Max();if ($norm == 2){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($min == 0){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($max == $lim-1){print "ok $n\n";} else {print "not ok $n\n";}$n++;$set->Empty();$set->Bit_On(0);$norm = $set->Norm();$min = $set->Min();$max = $set->Max();if ($norm == 1){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($min == 0){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($max == 0){print "ok $n\n";} else {print "not ok $n\n";}$n++;$set->Empty();$set->Bit_On($lim-1);$norm = $set->Norm();$min = $set->Min();$max = $set->Max();if ($norm == 1){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($min == $lim-1){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($max == $lim-1){print "ok $n\n";} else {print "not ok $n\n";}$n++;$set->Empty();$set->Bit_On(1);$set->Bit_On($lim-2);$norm = $set->Norm();$min = $set->Min();$max = $set->Max();if ($norm == 2){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($min == 1){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($max == $lim-2){print "ok $n\n";} else {print "not ok $n\n";}$n++;$set->Empty();$set->Bit_On(int($lim/2));$norm = $set->Norm();$min = $set->Min();$max = $set->Max();if ($norm == 1){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($min == int($lim/2)){print "ok $n\n";} else {print "not ok $n\n";}$n++;if ($max == int($lim/2)){print "ok $n\n";} else {print "not ok $n\n";}$n++;__END__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -