]> gitweb.factorcode.org Git - factor.git/blob - extra/math/approx/approx-tests.factor
factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool!
[factor.git] / extra / math / approx / approx-tests.factor
1 ! Copyright (C) 2010 John Benediktsson.
2 ! See http://factorcode.org/license.txt for BSD license
3
4 USING: kernel math math.approx math.constants
5 math.floating-point sequences tools.test ;
6
7 IN: math.approx.tests
8
9 { { 3 3 13/4 16/5 19/6 22/7 } }
10 [
11     pi double>ratio
12     { 1/2 1/4 1/8 1/16 1/32 1/64 }
13     [ approximate ] with map
14 ] unit-test
15
16 { { -3 -3 -13/4 -16/5 -19/6 -22/7 } }
17 [
18     pi double>ratio neg
19     { 1/2 1/4 1/8 1/16 1/32 1/64 }
20     [ approximate ] with map
21 ] unit-test