Skip to content

Commit 0d1dc0d

Browse files
committed
modified: Math/count_of_smooth_numbers.sf
modified: Math/count_of_smooth_numbers_2.sf
1 parent dc3769b commit 0d1dc0d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Math/count_of_smooth_numbers.sf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ func smooth_count(n, p) {
2020
}
2121

2222
for p in (primes(15)) {
23-
say ("Ψ(10^n, #{p}) for n < 10: ", 10.range.map { smooth_count(10**_, p) })
23+
var arr = 10.range.map {|n| smooth_count(10**n, p) }
24+
assert_eq(arr, 10.range.map {|n| p.smooth_count(10**n) })
25+
say ("Ψ(10^n, #{p}) for n < 10: ", arr)
2426
}
2527

2628
__END__

Math/count_of_smooth_numbers_2.sf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ func smooth_count(n, k) {
2020
}
2121

2222
for p in (primes(15)) {
23-
say ("Ψ(10^n, #{p}) for n < 10: ", 10.range.map { smooth_count(10**_, p) })
23+
var arr = 10.range.map {|n| smooth_count(10**n, p) }
24+
assert_eq(arr, 10.range.map {|n| p.smooth_count(10**n) })
25+
say ("Ψ(10^n, #{p}) for n < 10: ", arr)
2426
}
2527

2628
__END__

0 commit comments

Comments
 (0)