Skip to content

Conversation

ishikajais27
Copy link

@ishikajais27 ishikajais27 commented Mar 24, 2025

docs: precision documentation update for sin() function

We're enhancing the REPL documentation for @stdlib/math/base/special/sin to provide clearer, more accurate examples that better reflect the function's behavior.

Key Improvements

Exact Values Instead of Approximations

  • Changed ~0.0 to exact 0.0 for sin(0)
  • Updated all examples to show precise mathematical results

New Canonical Example

  • Added demonstration of sin(π) → 0.0 to showcase perfect circle math
  • Includes both JavaScript and C equivalent examples

Cross-Language Consistency

Ensured all examples match behavior in:

  • JavaScript
  • C (math.h)
  • Python (math.sin())

Improved Readability

  • Clearer formatting of examples
  • Better spacing between different cases
  • Consistent decimal precision

Test These Examples

JavaScript

const sin = require('@stdlib/math/base/special/sin');
sin(0);          // 0.0 (exact)
sin(Math.PI/2);  // 1.0 (exact)
sin(Math.PI);    // 0.0 (new example)

```C
#include <math.h>
sin(0.0);        // 0.0
sin(M_PI/2);     // 1.0
sin(M_PI);       // 0.0

- [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot stdlib-bot added First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review. labels Mar 24, 2025
Copy link
Contributor

@stdlib-bot stdlib-bot left a comment

Choose a reason for hiding this comment

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

👋 Hi there! 👋

And thank you for opening your first pull request! We will review it shortly. 🏃 💨

@ishikajais27
Copy link
Author

I’ve updated the PR description with the contributing guidelines acknowledgment and ensured commits are signed. Could someone with write access please review this PR? Thank you!

@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Mar 24, 2025
@kgryte kgryte added the autoclose: Spam Pull request which should be auto-closed as considered spam. label Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoclose: Spam Pull request which should be auto-closed as considered spam. First-time Contributor A pull request from a contributor who has never previously committed to the project repository.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants