Exponentiation example not clear

Started by PG Bug reporting formover 4 years ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/functions-math.html
Description:

Quoting the docs:

Exponentiation (unlike typical mathematical practice, multiple uses of ^
will associate left to right)
2 ^ 3 → 8
2 ^ 3 ^ 3 → 512

You could probably add

2 ^ (3 ^ 3) → 134217728 # 2 ^27

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: Exponentiation example not clear

PG Doc comments form <noreply@postgresql.org> writes:

Quoting the docs:

Exponentiation (unlike typical mathematical practice, multiple uses of ^
will associate left to right)
2 ^ 3 → 8
2 ^ 3 ^ 3 → 512

You could probably add

2 ^ (3 ^ 3) → 134217728 # 2 ^27

Seems reasonable, done at

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=7fa1e1ef741964eeb50f33d7c72622658bb7e5f4

regards, tom lane