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

MLDB-1735 make ln/log behave like postgresql's #622

Merged
merged 4 commits into from
Aug 18, 2016
Merged

Conversation

simlmx
Copy link
Contributor

@simlmx simlmx commented Aug 18, 2016

  • add support for log(x) and log(b,x) that match postgresql's functions
  • make log/ln and sqrt not fail on 0/negative values and return nan/-inf instead
  • fix a few typos in the doc
  • simplify the numeric-functions test file

Simon Lemieux added 3 commits August 18, 2016 12:05
- add support for log(x) and log(b,x) that match postgresql's log
  functions
- make log/ln and sqrt not fail on 0/negative values and return nan/-inf
  instead
- fix a few typos in the doc
@@ -778,17 +778,64 @@ registerMod(mod, std::make_shared<IntegerValueInfo>(), "mod");
double ln(double v)
{
if (v <= 0)
throw HttpReturnException(400, "the argument of the ln function must"
" be strictly positive");
cerr << "negative value encountered in ln" << endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the cerr, this could happen on every row and kill performance in a very nasty way.

@mathieumb
Copy link
Contributor

+1 after removing the cerr's.

@simlmx simlmx merged commit 8230cd9 into master Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants