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

feat: Support all java.lang.Math in the query language #6110

Merged
merged 51 commits into from
Oct 29, 2024

Conversation

chipkent
Copy link
Member

Newly supported methods and constants:

  • addExact
  • atan2
  • cbrt
  • copySign
  • cosh
  • decrementExact
  • expm1
  • floorDiv
  • floorMod
  • getExponent
  • hypot
  • IEEEremainder
  • incrementExact
  • log10
  • log1p
  • multiplyExact
  • negateExact
  • nextAfter
  • nextDown
  • nextUp
  • scalb
  • sinh
  • subtractExact
  • tanh
  • toDegrees
  • toRadians
  • toIntExact
  • toShortExact
  • toByteExact
  • ulp
  • E (constant)
  • PI (constant)

Resolves #5995.

//////////////////////////// Constants ////////////////////////////

/**
* The double value that is closer than any other to e, the base of the natural logarithms.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a nit but I think this is a tad didactic. How about just "The mathematical constant e, the base of the natural logarithm".

Copy link
Member Author

Choose a reason for hiding this comment

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

Docs are based off of the java.lang.Math wording.

static public final double E = Math.E;

/**
* The double value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter.
Copy link
Contributor

Choose a reason for hiding this comment

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

Also a nit, but likewise a tad didactic in my opinion. How about just "The mathematical constant pi".

Copy link
Member Author

Choose a reason for hiding this comment

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

Docs are based off of the java.lang.Math wording.

engine/function/src/templates/Numeric.ftl Outdated Show resolved Hide resolved
engine/function/src/templates/Numeric.ftl Outdated Show resolved Hide resolved
engine/function/src/templates/Numeric.ftl Outdated Show resolved Hide resolved
engine/function/src/templates/Numeric.ftl Outdated Show resolved Hide resolved
engine/function/src/templates/Numeric.ftl Outdated Show resolved Hide resolved
engine/function/src/templates/Numeric.ftl Outdated Show resolved Hide resolved
engine/function/src/templates/Numeric.ftl Outdated Show resolved Hide resolved
engine/function/src/templates/Numeric.ftl Outdated Show resolved Hide resolved
@chipkent chipkent changed the title Support all java.lang.Math in the query language feat: Support all java.lang.Math in the query language Oct 23, 2024
engine/function/src/templates/Numeric.ftl Outdated Show resolved Hide resolved
engine/function/src/templates/Numeric.ftl Outdated Show resolved Hide resolved
engine/function/src/templates/Numeric.ftl Outdated Show resolved Hide resolved
engine/function/src/templates/Numeric.ftl Outdated Show resolved Hide resolved
kosak
kosak previously approved these changes Oct 29, 2024
@chipkent chipkent enabled auto-merge (squash) October 29, 2024 15:00
@chipkent chipkent merged commit 09eeedb into deephaven:main Oct 29, 2024
17 checks passed
@chipkent chipkent deleted the java_lang_math branch October 29, 2024 18:18
@deephaven-internal
Copy link
Contributor

Labels indicate documentation is required. Issues for documentation have been opened:

Community: deephaven/deephaven-docs-community#345

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support all java.lang.Math in the query language
3 participants