Revision: | 1.3 |
Committed: | Wed Nov 21 18:10:45 2018 UTC (5 years, 5 months ago) by greg |
Branch: | MAIN |
CVS Tags: | rad5R4, rad5R3, HEAD |
Changes since 1.2: | +3 -0 lines |
Error occurred while calculating annotation data. | |
Log Message: | Added missing RCSid tag |
# | Content |
---|---|
1 | { RCSid $Id$ } |
2 | { Use continued fraction calculation to derive rational number from real } |
3 | |
4 | frac(x,e) : x - floor(x+e); |
5 | sq(x) : x * x; |
6 | |
7 | denom(x,e) : if( e-frac(x,e), 1, if( e-frac(1/x,e), floor(1/x+e), |
8 | denom(frac(1/frac(1/x,e),e),e/sq(x*frac(1/x,e))) + |
9 | floor(1/x+e)*denom(frac(1/x,e),e/sq(x)) ) ); |