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

bc: add a line about interactive usage with mathlib #1144

Merged
merged 3 commits into from Feb 26, 2017

Conversation

kalebo
Copy link
Contributor

@kalebo kalebo commented Oct 31, 2016

Usually bc isn't very useful if it doesn't return floating point numbers where appropriate. e.g., 3/4 returns 0 when started with -i but for most users they would expect 0.75 to be returned so the tldr should mention that the argument -ldoes floating point arithmetic.

Usually `bc` isn't very useful if it doesn't return have floating point number where appropriate. e.g., 3/4 returns 0 when started with `-i` but for most users they would expect 0.75 to be returned so the argument `-l`does what the user would generally want.
@mention-bot
Copy link

@kalebo, thanks for your PR! By analyzing the history of the files in this pull request, we identified @igorshubovych and @rubenvereecken to be potential reviewers.

@waldyrious waldyrious added the page edit Changes to an existing page(s). label Nov 1, 2016
@waldyrious waldyrious changed the title Added a line about interactive usage with mathlib bc: add a line about interactive usage with mathlib Nov 1, 2016
@waldyrious
Copy link
Member

LGTM 👍

@agnivade
Copy link
Member

I am a bit confused on this.

The man page for bc on my ubuntu box says -l, --mathlib- Define the standard math library. for this option. But the PR mentions in interactive mode with floating point support. First of all, will -l invoke interactive mode too ? And are floating point support and math library one and the same ? If yes, then we should use the later to denote [l].

@kalebo
Copy link
Contributor Author

kalebo commented Nov 19, 2016

@agnivade Yes, both -i and -l put bc into interactive mode. And yes, -l really means load the std math library. I agree the wording could be clearer.

The main issue that I see is that most people assume that a calculator should handle things like floating point division by default, but bc does not do that without specifying -l. I would almost say it's better to remove the line about -i and replace it with a line that uses -l and perhaps state that it puts in into interactive mode with standard math libraries and floating point support. Or something to that effect.

@agnivade
Copy link
Member

No worries, just use f[l]oating and we should be good.

@waldyrious
Copy link
Member

IIUC the "l" in -l refers to "lib(rary)", right? How about "Run calculator using the standard math library, for floating point support (this enables interactive mode)"?

* merged lines about interactive mode and mathlib
@kalebo
Copy link
Contributor Author

kalebo commented Nov 21, 2016

I reworded the entry as I realized that floating point support does not come from mathlib.You can run scale=20 and get the same result in normal mode. However, enabling mathlib support also sets scale=20 automatically. Ideally if a user just wants to run some quick calculations, including -l is easier than including scale=x which is more of a feature you'd want if you were writing a script. For this reason I replaced the line about -i with the one about -l since most users would expect their calculations not to be truncated at the decimal.

@waldyrious
Copy link
Member

What exactly is the scale? Number of decimal places for calculation results?

@waldyrious waldyrious added the waiting Issues/PRs with Pending response by the author. label Dec 21, 2016
@agnivade
Copy link
Member

Hey @kalebo - Could you update the scale example to include the word 'decimal' too ? 'decimal precision' sounds much more clear than just 'precision'.

* 'decimal places' used instead of 'precision'  
* Implicit example of using scale
@kalebo
Copy link
Contributor Author

kalebo commented Feb 25, 2017

I switched up the wording in the scale example. I'm a little torn between leaving in that example and ditching it. In short I don't want to make the tldr too in depth but bc's defaults are a bit of a stumbling block that I think would be nice to warn people about.

@agnivade
Copy link
Member

Sure, LGTM.

@agnivade agnivade merged commit 262561c into tldr-pages:master Feb 26, 2017
@kalebo kalebo deleted the patch-1 branch February 27, 2017 14:20
@bl-ue bl-ue removed the waiting Issues/PRs with Pending response by the author. label Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
page edit Changes to an existing page(s).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants