11 Jul
2004
11 Jul
'04
1:02 a.m.
On Thu, Jul 08, 2004 at 10:42:17AM -0700, Marc LeBrun wrote:
BTW I've shared RCS's interesting experience of the surprising messiness of such algorithms, ...
OK, I'll bite.
such as determining whether p+qx < r+sx for signed p,q,r,s using only integer operations.
What's wrong with (p-r > 0 && q-s > 0 && (p-r)^2 < k*(q-s)^2) || (p-r < 0 && q-s < 0 && (p-r)^2 > k*(q-s)^2) ? [As before, x = sqrt(k)]
Heck, I'd even pay $50 for an easy way to generate a+bx in increasing order for a,b >=0 (if you think you have one contact me to negotiate the definition of "easy"<;-).
Err, it is easy once you have the continued fraction expansion, right? Is the issue getting the continued fraction expansion? Peace, Dylan