Talk:Common operator notation: Difference between revisions

Content deleted Content added
add a question about whether an example demonstrating a sometimes confusion thinking of precedence of a prefix minus sign would be beneficial to add
Implementing WP:PIQA (Task 26)
 
(7 intermediate revisions by 5 users not shown)
Line 1:
{{WikiProject banner shell|class=Start|
{{WikiProject Computer science |importance=Low}}
}}
ي
 
==[Untitled]==
Do programming languages actually exist where <tt>sin</tt> is a prefix operator? As far as I know, it's always a function requiring parentheses around its argument <tt>sin(x)</tt>, thus avoiding the ambiguity mentioned in the article.
<br>&mdash;[[User:Herbee|Herbee]] 11:37, 2004 Mar 5 (UTC)
 
: Yes. [[Haskell programming language|Haskell]] has such a function, as well as <tt>sin</tt> appearing as a postfix operator in the [[PostScript programming language]]. [[User:Dysprosia|Dysprosia]] 11:55, 5 Mar 2004 (UTC)
 
:: Not to mention several BASIC dialects (not only Sinclair's or Hewlett Packard's) or ordinary scientific calculators (Canon, Sharp, most CASIOs etc) where sin 2π = 0, just as in mathematics (i.e. implicit multiplication goes before prefix operators).
 
:: Also, operators may well be regarded as functions in their own right... and many function-oriented ("functional") languages demand no parenthesis-syntax for an ordinary prefix-operator/function. You simply write sin x, just as in mathematics. <span style="font-size: smaller;" class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/83.253.247.136|83.253.247.136]] ([[User talk:83.253.247.136|talk]]) 19:08, 15 November 2012 (UTC)</span><!-- Template:Unsigned IP --> <!--Autosigned by SineBot-->
 
Is ''Common operator notation'' really a term in Computer Science? There's only 125 Google references, and almost all of those are to copies of this page. There is a commonality of operator notation among the computer languages descendent mostly from [[Fortran]], but this page rambles on for quite a while without really capturing the essence of the idea. (Sorry for being vague, but this article's vague approach to its topic gave me a vague impression of vagueness.) [[User:Tom Duff|Tom Duff]] 19:49, 23 August 2006 (UTC)
Line 11 ⟶ 21:
-2^2 (or -2**2, depending on what plain ASCII notation one wants to follow), along with some sort of authoratative reference, would be useful to add to the page.
 
I wonder this because the algebraic result of -4 is not necessarility obvious to people who read the notation (I know that I've seen arguments in web forums/newsgroups/mailing lists over whether this should be -(2*2) or (-2*-2). It seems like specifically noting the correct algebraic interpretation would be worthwhile in the context of operation precendence and notation. <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/134.243.209.109|134.243.209.109]] ([[User talk:134.243.209.109|talk]]) 14:10, 26 May 2009 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->