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

Open
wants to merge 47 commits into
base: main
Choose a base branch
from

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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