agora inbox for pgsql-docs@postgresql.org  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: pramodsavant2001@gmail.com
Subject: Mathematical Functions and Operators
Date: Sun, 08 Sep 2024 04:43:01 +0000
Message-ID: <172577058189.711.5933453138059481244@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

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

Typically, exponentiation (which is represented here by ^) is a
right-associative operation. This means that the expression 2 ^ 3 ^ 3 should
be interpreted as 
2 ^ (3 ^ 3) rather than (2 ^ 3) ^ 3.

Correct Interpretation (right-associative):
2 ^ 3 ^ 3 is interpreted as 2 ^ (3 ^ 3), which equals 2 ^ 27 = 134217728.
However, the example provided assumes left-associative behavior:

Incorrect Interpretation (left-associative):
2 ^ 3 ^ 3 is incorrectly interpreted as (2 ^ 3) ^ 3 = 512.


view thread (2+ messages)  latest in thread

Message-ID: <172577058189.711.5933453138059481244@wrigleys.postgresql.org>
Permalink:  ../172577058189.711.5933453138059481244@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/172577058189.711.5933453138059481244@wrigleys.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, pramodsavant2001@gmail.com
  Subject: Re: Mathematical Functions and Operators
  In-Reply-To: <172577058189.711.5933453138059481244@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox