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

Documentation: Mathematical constants are split between the math functions and numeric data type documentation pages #832

Closed
2 tasks done
matthewjnield opened this issue Sep 9, 2024 · 5 comments · Fixed by #860
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@matthewjnield
Copy link
Contributor

matthewjnield commented Sep 9, 2024

Description

Currently, SurrealDB's various mathematical constants are partially documented in two different pages; each of which has some, but not all of the constants. The two pages are:

The following constants are only on the documentation page for the numeric data types:
MATH::FRAC_1_PI
MATH::FRAC_1_SQRT_2
MATH::FRAC_2_PI
MATH::FRAC_2_SQRT_PI
MATH::FRAC_PI_2
MATH::FRAC_PI_3
MATH::FRAC_PI_4
MATH::FRAC_PI_6
MATH::FRAC_PI_8
MATH::LN_10
MATH::LN_2
MATH::LOG10_2
MATH::LOG10_E
MATH::LOG2_10
MATH::LOG2_E
MATH::SQRT_2

The following constants are only on the documentation page for the math function module:
math::inf
math::neg_inf

The following constants are on both of the documentation pages:
MATH::E
MATH::PI
MATH::TAU

If all of these constants should be documented on one and only one of these two pages, I will gladly make a pull request removing all constants from one page and adding the missing constants to the other page.

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@matthewjnield matthewjnield added the documentation Improvements or additions to documentation label Sep 9, 2024
@Dhghomon
Copy link
Contributor

Thanks for noticing this! I was tempted to suggest moving everything to the functions page because that sets the stage for a discussion about module paths and maybe towards consts in other areas as well (http::localhost or some sort of geo:: or time:: consts) but the current consts in the data model page is nicely set up and consts are easy to keep track of. So I think having them in both places makes the most sense.

While writing this comment I see we have a const in the source code that is ready to go but simply doesn't have its path set up (time::epoch). Going to add it now.

image

@matthewjnield
Copy link
Contributor Author

@Dhghomon Do you think both pages that I mentioned above should be left as they currently are, or that all math constants should be listed on each? On the math functions page, do you think that the constants that are currently listed among the functions should be put in a separate list for constants only?

@Dhghomon
Copy link
Contributor

@matthewjnield Good question, I think I lean towards having the constants listed together with the functions as it looks nice on the ON THIS PAGE scrollable menu on the right and keeps everything together in a single alphabetical order. And having all math constants on the one page as well as inside the math functions is fine too as people could easily find them using one path vs. the other. And constants are pretty unchanging compared to functions so it wouldn't lead to the headache of multiple versions on multiple pages.

@matthewjnield
Copy link
Contributor Author

matthewjnield commented Sep 17, 2024

@Dhghomon Thanks, I will prepare the changes to be made to the two pages in order to have them both include all of the match constants. I will finalize the changes on a fresh branch and open a pull request after #854 is merged to avoid having to resolve conflicts arising from the switch from Docusaurus to Astro.

@matthewjnield
Copy link
Contributor Author

I have opened pull request #860 to make this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
2 participants