Talk:bc (programming language)

Latest comment: 2 years ago by Photon89 in topic Power function in C?


Untitled

edit

Just to head off any claims that the external link is self-promotion, I've got nothing to do with the CyrexSoft site. I spent about an hour implementing arccosine in bc before finding this link, so it would have helped me greatly. --Dantheox 06:20, 23 December 2005 (UTC)Reply

A paragraph and additional reference relating to the dialect C-BC have been added. -- Mark Hopkins, 5 February 2006

Actual usage

edit

It would be nice to see a list of its actual uses and users today.

Is it actually used by anyone for practical purposes? I've seen that it's called "an arbitrary precision calculator dating back from Unix stone age" (in the Parrot virtual machine source tree). --Amir E. Aharoni 11:01, 14 August 2006 (UTC)Reply

I may be a little biased, since I developed C-BC. But, in fact, I use the language more frequently than C, itself, because of its interpretative ability and high precision math. Often, I will also use it for prototyping C programs or for writing elaborate shell scripts. A link to the source code for the larger language C-BC was not provided on the main page. But a copy of the source can be found in alt.sources from October 3, 1993, by doing a search in Google's USENET archive (Google groups).

-- Mark, 13 September 2006

not everyone knows C

edit

Can we drop the references to C.

I am sure this can be described without referencing a language many people don't know.

PS I use occasionally, but like most unix tools , I am sure I'd use it more if I udnerstood it better.

DGerman 00:05, 10 December 2006 (UTC)Reply

That would be a little difficult, since BC is based on C and was intently designed as a stripped down version of C, originally to provide a front-end for DC with a syntax more amenable for C programmers.

-- Mark, 12 December 2006

Requested move

edit

Bc programming languageBc (Unix) — The current article name doesnt conform to the naming conventions. Bc is a Unix command line utility and is not a complete programming language, so I consider Bc (Unix) to be a better move than Bc (programming language). John Vandenberg 02:45, 4 March 2007 (UTC)Reply

Survey

edit
Add  # '''Support'''  or  # '''Oppose'''  on a new line in the appropriate section followed by a brief explanation, then sign your opinion using ~~~~. Please remember that this survey is not a vote, and please provide an explanation for your recommendation.

Survey - in support of the move

edit

Survey - in opposition to the move

edit

Discussion

edit

Are there non-unix implementations of bc? If so, that would resolve this immediately. bc is most certainly a complete programming language. It can be thought of as a simplified variant of C with built-in support for arbitrary-precision arithmetic. --dantheox 08:55, 4 March 2007 (UTC)Reply

I dont think that merely having non-unix implementations would be sufficient on its own. e.g. sort (Unix) is also part of MSYS. If there were pre-Unix impl. of bc, that would definately mean "(Unix)" isnt the right tail.
OTOH, I'm not really overly concerned about what name is chosen, so I'm happy to go with bc (programming language) if you think that's the more reasonable name. John Vandenberg 09:41, 4 March 2007 (UTC)Reply

History

edit

Do we know where, when, why and by whom bc was first created? —Preceding unsigned comment added by 89.105.29.6 (talk) 19:29, 25 November 2008 (UTC)Reply

I fixed the missing (and worse, misrepresented) history in the introductory paragraph. Nyh (talk) 08:41, 4 May 2011 (UTC)Reply

Why is it called "bc"?

edit

"Dc" is called "dc" because it stands for desk calculator, but where did the name "bc" come from? Does the 'c' in "bc" stand for calculator, like in "dc", or is it a reference to the C programming language because of its syntax, or neither? 69.54.60.34 (talk) 16:17, 21 August 2010 (UTC)Reply

As the article explains, bc is short for "Bench Calculator". This is also the explanation I was given 25 years ago, when I first learned bc. However, I never understood what the phrase "bench calculator" actually means, or why a "bench" calculator is different from a "desk" calculator. I can't find any reasonable explanation why this word was used, or any proof that "bench calculator" isn't just a backronym. Nyh (talk) 11:45, 23 October 2011 (UTC)Reply
This is an incorrect information and that is why I just changed its full name as given in the article to the correct basic calculator. See so for instance:
http://www.websters-online-dictionary.org/definitions/BC?cx=partner-pub-0939450753529744%3Av0qd01-tdlq&cof=FORID%3A9&ie=UTF-8&q=BC&sa=Search#906
You'll have to scroll down to the section "Math and technology". If this does not suffice, please, do a simple Google search on both terms respectiveley. You're going to get what I got: Something like "GNU (or UNIX) + bc + "bench calculator"" gives, like, 500 results. Doing the same as "GNU (or UNIX) + bc + "basic calculator"" yields thousands of results. Done deal! Zero Thrust (talk) 11:32, 27 February 2012 (UTC)Reply
Amazing. And for 25 years I was *sure* the B was for "bench". Looking at Google, other people are equally sure that it's "Bell Calculator", "Better Calculator". Amazingly, none of the Unix manual pages or books I have which talk about bc(1) ever explain its name. The name "Bench Calculator" is definitely not my own invention - try searching on scholar.google.com for the phrase "bench calculator", and you can some 20 year old references to bc with this name. So the origin of the name remains a mystery, as far as I'm concerned, and I'm not convinced it's "basic calculator". Nyh (talk) 13:50, 27 February 2012 (UTC)Reply
bc stands for "basic calculator". That is the correct answer. --93.229.172.168 (talk) 19:27, 24 February 2021 (UTC)Reply

Dangerous

edit

This program is outright dangerous. It outputs "1" for "5/4". Yes yes, I know I need to input the expression differently, but for any casual user who didn't grow up in the backward UNIX world, the fact that this program gives totally wrong results for the simplest expressions is dangerous. — Preceding unsigned comment added by Intrr (talkcontribs) 20:42, 12 January 2011 (UTC) I added a statement to this effect in the introductory section. Nyh (talk) 08:47, 4 May 2011 (UTC)Reply

Dangerous? Have you ever heard of integer division? Are you familiar with any programming languages that were devised before, oh, 1980 and were not spoon-fed in a "college textbook" for undisciplined imbeciles? — Preceding unsigned comment added by 98.249.207.46 (talk) 02:09, 1 March 2013 (UTC)Reply

Maybe dangerous was hyperbole and the given example a poor choice, but it has its shortcomings which might warrant its own section. E.g. the GNU implementation gets the last digit wrong if one attempts to calculate Pi using '4*a(1)' at any scale. — Preceding unsigned comment added by 69.181.225.53 (talk) 20:36, 1 May 2020 (UTC)Reply

Just run the program with the parameter -l then it will calculate "5/4" the way you want to have it. Without the parameter -l it is using integer calculation, which means all floating point numbers after the separator will be truncated. --84.158.122.178 (talk) 12:17, 30 December 2021 (UTC)Reply

power function

edit

There are two implementations of power function - one POSIX and one GNU - but I can't find any differences between them except variable naming and syntax subtleties (but the article states that GNU is backward compatible, so why keep two implementations)? 83.220.51.26 (talk) 13:41, 6 December 2011 (UTC)Reply

Agreed, will remove it. It's a bit more readable and less efficient (extra call to int), but otherwise identical. 2A01:260:D001:F797:4D43:67FC:5DB7:DF1 (talk) 21:53, 13 November 2018 (UTC)Reply
edit

Hello fellow Wikipedians,

I have just modified one external link on Bc (programming language). Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:

When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at {{Sourcecheck}}).

This message was posted before February 2018. After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than regular verification using the archive tool instructions below. Editors have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the RfC before doing mass systematic removals. This message is updated dynamically through the template {{source check}} (last update: 5 June 2024).

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

Cheers.—InternetArchiveBot (Report bug) 06:16, 29 October 2016 (UTC)Reply

Power function in C?

edit

Referring to "3.1.1.3 Conflicting with C": How is the sentence "Of particular note, the use of the ^ operator with negative numbers does not follow the C operator precedence" to be interpreted, since there is no analogous operator in C and the power function pow(x,y) never exhibits the ambiguity of binding the minus sign? Photon89 (talk) 08:34, 10 August 2022 (UTC)Reply