Skip to content

Conversation

marcxjo
Copy link

@marcxjo marcxjo commented Jun 16, 2024

Fixes #76.

rcalc() {
expr=${@}

echo "scale=1; $expr" | bc | cut -d. -f1
Copy link
Author

@marcxjo marcxjo Jun 16, 2024

Choose a reason for hiding this comment

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

Note that setting scale to 1 here allows folks to use fractional ratio representations like 1 / 3 (albeit with noticeably imperfect accuracy for irrational values with multi-digit or non-terminating decimal expansions).

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.

Inconsistent behavior with --master-size flag
1 participant