Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose C log2 function to SQL #3946

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Expose C log2 function to SQL #3946

monetdb-team opened this issue Nov 30, 2020 · 0 comments


Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2016-03-08 11:14:08 +0100
From: @swingbit
To: SQL devs <>
Version: -- development
CC: @eyalroz, martin.van.dinther

Last updated: 2019-04-30 12:36:01 +0200

Comment 21870

Date: 2016-03-08 11:14:08 +0100
From: @swingbit

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36
Build Identifier:

SQL provides log (natural log) and log10 (base 10) functions:

sql>select name,func from sys.functions where name like 'log%';
| name | func |
| log | log |
| log10 | log10 |
| log | log |
| log10 | log10 |

Their implementation is a straightforward mapping onto the C library implementation:


It would be nice to expose the same way "log2" (base 2), which is also available in the C standard library.

This is not very urgent, as one can always write log2(x) = log(x) / log(2). But the log2 implementation is probably faster and since log10 is exposed, it seems logical to also expose log2.

Reproducible: Always

Comment 21871

Date: 2016-03-10 14:46:43 +0100
From: Martin van Dinther <<martin.van.dinther>>

When implementing this request, also implement function LN(), see Bug #3520

Comment 24620

Date: 2016-10-24 23:45:06 +0200
From: @eyalroz

Isn't this a dupe of bug #3416?

Comment 26833

Date: 2019-01-22 12:41:13 +0100
From: MonetDB Mercurial Repository <>

Changeset ac79383ea2ce made by Sjoerd Mullender in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ac79383ea2ce

Changeset description:

Implemented function log2.
This fixes bug #3946.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant