Hello! I'm developer developing swift version of pgrational for storing user defined order in DB.
Can I ask a question?
I want to know the reason why while loop is used in intermediate? I think executing mediant(&x, &y, med) once is much faster than mediant(&lo, &hi, med) with loop. I suppose that there are some mathematical reasons or technical purposes to do so.
Hello! I'm developer developing swift version of pgrational for storing user defined order in DB.
Can I ask a question?
I want to know the reason why while loop is used in intermediate? I think executing
mediant(&x, &y, med)
once is much faster thanmediant(&lo, &hi, med)
with loop. I suppose that there are some mathematical reasons or technical purposes to do so.https://github.com/begriffs/pg_rational/blob/70c4decc03773c86ffdda829e39ef39011cc205e/pg_rational.c#L380-L389