Thread

Commits

  1. Doc: fix a couple of erroneous examples.

  1. funcs.sgml - wrong example

    Erik Rijkers <er@xs4all.nl> — 2022-05-18T01:08:32Z

    funcs.sgml  has
    
       42 <@ '{[1,7)}'::int4multirange
    
    and calls it true.  The attached fixes that.
    
    Included are two more changes where actual output differs a bit from 
    what the doc examples show.
    
    Erik
    
    
  2. Re: funcs.sgml - wrong example

    Kyotaro Horiguchi <horikyota.ntt@gmail.com> — 2022-05-18T02:11:02Z

    At Wed, 18 May 2022 03:08:32 +0200, Erik Rijkers <er@xs4all.nl> wrote in 
    > funcs.sgml  has
    > 
    >   42 <@ '{[1,7)}'::int4multirange
    > 
    > and calls it true.  The attached fixes that.
    > 
    > Included are two more changes where actual output differs a bit from
    > what the doc examples show.
    
    A bit off-topic and just out of curiocity, is there a reason other
    than speed (and history?) for that we won't truncate trailing zeros in
    the output of log(b,n)?
    
    Since we have get_min_scale since 13, for example, with the following
    tweak, we get 6.0 for log(2.0, 64.0), which looks nicer.
    
    
    @@ -10300,6 +10300,8 @@ log_var(const NumericVar *base, const NumericVar *num, NumericVar *result)
     	/* Divide and round to the required scale */
     	div_var_fast(&ln_num, &ln_base, result, rscale, true);
     
    +	result->dscale = Max(get_min_scale(result), base->dscale);
    +	result->dscale = Max(result->dscale, num->dscale);
     	free_var(&ln_num);
    
    regards.
    
    -- 
    Kyotaro Horiguchi
    NTT Open Source Software Center
    
    
    
    
  3. Re: funcs.sgml - wrong example

    Kyotaro Horiguchi <horikyota.ntt@gmail.com> — 2022-05-18T02:19:31Z

    At Wed, 18 May 2022 11:11:02 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in 
    > At Wed, 18 May 2022 03:08:32 +0200, Erik Rijkers <er@xs4all.nl> wrote in 
    > > funcs.sgml  has
    > > 
    > >   42 <@ '{[1,7)}'::int4multirange
    > > 
    > > and calls it true.  The attached fixes that.
    > > 
    > > Included are two more changes where actual output differs a bit from
    > > what the doc examples show.
    
    Forgot to mention, the all changes look good.  The log(b,n) has 16
    trailing digits at least since 9.6.
    
    > A bit off-topic and just out of curiocity, is there a reason other
    > than speed (and history?) for that we won't truncate trailing zeros in
    > the output of log(b,n)?
    
    Hmm. A bit wrong. I meant that, if we can allow some additional cycles
    and we don't stick to the past behavior of the function, we could have
    a nicer result.
    
    > Since we have get_min_scale since 13, for example, with the following
    > tweak, we get 6.0 for log(2.0, 64.0), which looks nicer.
    > 
    > 
    > @@ -10300,6 +10300,8 @@ log_var(const NumericVar *base, const NumericVar *num, NumericVar *result)
    >  	/* Divide and round to the required scale */
    >  	div_var_fast(&ln_num, &ln_base, result, rscale, true);
    >  
    > +	result->dscale = Max(get_min_scale(result), base->dscale);
    > +	result->dscale = Max(result->dscale, num->dscale);
    >  	free_var(&ln_num);
    
    -- 
    Kyotaro Horiguchi
    NTT Open Source Software Center
    
    
    
    
  4. Re: funcs.sgml - wrong example

    Justin Pryzby <pryzby@telsasoft.com> — 2022-06-01T12:10:58Z

    On Wed, May 18, 2022 at 03:08:32AM +0200, Erik Rijkers wrote:
    > funcs.sgml  has
    > 
    >   42 <@ '{[1,7)}'::int4multirange
    > 
    > and calls it true.  The attached fixes that.
    > 
    > Included are two more changes where actual output differs a bit from what
    > the doc examples show.
    
    This patch is RFC but seems to have been forgotten.
    Feel free to add it to the next CF if nobody applies it.
    
    Note that I needed to apply it with use git am -p0 - I think it was created
    with vanilla diff.
    
    -- 
    Justin
    
    
    
    
  5. Re: funcs.sgml - wrong example

    Tom Lane <tgl@sss.pgh.pa.us> — 2022-06-01T14:41:38Z

    Justin Pryzby <pryzby@telsasoft.com> writes:
    > On Wed, May 18, 2022 at 03:08:32AM +0200, Erik Rijkers wrote:
    >> funcs.sgml  has
    >> 42 <@ '{[1,7)}'::int4multirange
    >> and calls it true.  The attached fixes that.
    >> 
    >> Included are two more changes where actual output differs a bit from what
    >> the doc examples show.
    
    > This patch is RFC but seems to have been forgotten.
    > Feel free to add it to the next CF if nobody applies it.
    
    Pushed now.  I modified that example to 4 <@ '{[1,7)}'::int4multirange
    so that it would indeed return true, which is our usual style.
    
    			regards, tom lane