2009-03-02 13:10:43 -05:00
|
|
|
USING: kernel math.constants math.continued-fractions tools.test ;
|
|
|
|
|
2015-07-02 16:37:42 -04:00
|
|
|
[ V{ 2 2.0 } ] [ V{ 2.5 } dup next-approx ] unit-test
|
|
|
|
[ V{ 2 2 } ] [ V{ 2.5 } dup next-approx dup next-approx ] unit-test
|
2009-03-02 13:10:43 -05:00
|
|
|
|
2015-07-02 16:37:42 -04:00
|
|
|
[ 5/2 ] [ V{ 2 2.1 } >ratio ] unit-test
|
|
|
|
[ 5/2 ] [ V{ 2 1.9 } >ratio ] unit-test
|
|
|
|
[ 5/2 ] [ V{ 2 2.0 } >ratio ] unit-test
|
|
|
|
[ 5/2 ] [ V{ 2 2 } >ratio ] unit-test
|
2009-03-02 13:10:43 -05:00
|
|
|
|
2015-07-02 16:37:42 -04:00
|
|
|
[ 3 ] [ 1 pi approx ] unit-test
|
|
|
|
[ 22/7 ] [ 0.1 pi approx ] unit-test
|
|
|
|
[ 355/113 ] [ 0.00001 pi approx ] unit-test
|
2009-03-02 13:10:43 -05:00
|
|
|
|
2015-07-02 16:37:42 -04:00
|
|
|
[ 2 ] [ 1 2 approx ] unit-test
|
|
|
|
[ 2 ] [ 0.1 2 approx ] unit-test
|
|
|
|
[ 2 ] [ 0.00001 2 approx ] unit-test
|
2009-03-02 13:10:43 -05:00
|
|
|
|
2015-07-02 16:37:42 -04:00
|
|
|
[ 3 ] [ 1 2.5 approx ] unit-test
|
|
|
|
[ 5/2 ] [ 0.1 2.5 approx ] unit-test
|
|
|
|
[ 5/2 ] [ 0.0001 2.5 approx ] unit-test
|