Re: POC: rational number type (fractions) - Mailing list pgsql-hackers

From Joe Nelson
Subject Re: POC: rational number type (fractions)
Date
Msg-id 20200222022423.GH42864@begriffs.com
Whole thread Raw
In response to Re: POC: rational number type (fractions)  (Joe Nelson <joe@begriffs.com>)
List pgsql-hackers
Joe Nelson wrote:
> where the denominator is made positive whenever possible (not possible
> when it's -INT_MAX).

(I meant INT_MIN rather than -INT_MAX.)

Another more-than-one-way-to-do-it task is converting a float to a
fraction.  I translated John Kennedy's method [0] to C, but Github user
adegert sent an alternative [1] that matches the way the CPython
implementation works.

0: https://begriffs.com/pdf/dec2frac.pdf 
1: https://github.com/begriffs/pg_rational/pull/13



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Transactions involving multiple postgres foreign servers, take 2
Next
From: "David G. Johnston"
Date:
Subject: Re: Make java client lib accept same connection strings as psql