Jump to content

Talk:Common operator notation

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

ي

[Untitled]

[edit]

Do programming languages actually exist where sin is a prefix operator? As far as I know, it's always a function requiring parentheses around its argument sin(x), thus avoiding the ambiguity mentioned in the article.
Herbee 11:37, 2004 Mar 5 (UTC)

Yes. Haskell has such a function, as well as sin appearing as a postfix operator in the PostScript programming language. 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. — Preceding unsigned comment added by 83.253.247.136 (talk) 19:08, 15 November 2012 (UTC)[reply]

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.) Tom Duff 19:49, 23 August 2006 (UTC)[reply]


The example at the end of -3! hints at how the uniry minus binds later than the !. I wonder if an example such as

-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. —Preceding unsigned comment added by 134.243.209.109 (talk) 14:10, 26 May 2009 (UTC)[reply]