BUG #16901: log(1, anyvalue) gives division by zero error

Started by PG Bug reporting formabout 5 years ago3 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 16901
Logged by: Sam Woodward
Email address: samuelwoodward@gmail.com
PostgreSQL version: 13.2
Operating system: Windows 10
Description:

for example log(1, 10) gives division by zero error whereas log10(1) gives 0

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: BUG #16901: log(1, anyvalue) gives division by zero error

PG Bug reporting form <noreply@postgresql.org> writes:

for example log(1, 10) gives division by zero error whereas log10(1) gives 0

I think you have the arguments backwards: the equivalent
computation is log(10, 1) not log(1, 10).

regards, tom lane

#3Samuel Woodward
samuelwoodward@gmail.com
In reply to: Tom Lane (#2)
Re: BUG #16901: log(1, anyvalue) gives division by zero error

Doh.. 🤦‍♂️

On Fri, 26 Feb 2021, 16:55 Tom Lane, <tgl@sss.pgh.pa.us> wrote:

Show quoted text

PG Bug reporting form <noreply@postgresql.org> writes:

for example log(1, 10) gives division by zero error whereas log10(1)

gives 0

I think you have the arguments backwards: the equivalent
computation is log(10, 1) not log(1, 10).

regards, tom lane