Re: POC: rational number type (fractions)

From: Joe Nelson <joe(at)begriffs(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: POC: rational number type (fractions)
Date: 2020-02-22 02:24:23
Message-ID: 20200222022423.GH42864@begriffs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2020-02-22 03:04:42 Re: Make java client lib accept same connection strings as psql
Previous Message Masahiko Sawada 2020-02-22 02:14:58 Re: Transactions involving multiple postgres foreign servers, take 2