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