Skip to content

Commit f1e2a10

Browse files
committed
Add new compatibility method for Pharo < 11
1 parent c68e506 commit f1e2a10

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Extension { #name : #SequenceableCollection }
2+
3+
{ #category : #'*Math-CompatibilityUpToPharo11' }
4+
SequenceableCollection >> closeTo: aSequenceableCollection precision: aPrecision [
5+
"Return true if all my elements are close to the elements of same index of the parameter with a certain precision"
6+
7+
"(#(1.9283 2.3029) closeTo: #(1.9284 2.3028) precision: 0.001) >>> true"
8+
9+
self with: aSequenceableCollection do: [ :a :b | (a closeTo: b precision: aPrecision) ifFalse: [ ^ false ] ].
10+
^ true
11+
]

0 commit comments

Comments
 (0)