Welcome to roadsat.com on July 10 2009.
This is an internet experiment running to monitor browsing habbits of individuals through wikipedia contents.

Talk:Unary operation

From Wikipedia, the free encyclopedia

Jump to: navigation, search

I added a phrase on the notion of "single input" which seems not very meaningful to me. An example should be added (e.g. a "binary" (mathematical) function defined on AxB is a unary function defined on E where E=AxB ; a function proc(name,age,address) could as well be written as a function proc(person) where person = struct{name,age,address}, and of course this is already true in a hidden way for several "hidden" complex types (complex number = (real part,imag part), long int = (low word, high word), etc.))

It could be discussed whether this might not apply to functions with various types of "arguments" (in / inout / out) (where the latter are in fact an "improper" way to return the output). — MFH:Talk 12:50, 17 October 2006 (UTC)

[edit] Factorial

Isn't factorial an unary oparation?

[edit] Examples of Unary Operations

Not all of these are unary:

  • the absolute value operation is a unary operation on the real numbers
    • OK
  • the opposite operation (-x) on the real numbers
    • This is a binary operation. This is the same as multiplying by -1, which is binary operation that requires two operands, x and -1.
  • the power operation (squaring, cubing, etc) on the real numbers
    • Again, this requires two operands. x^n requires both x and n as input values.
  • the factorial operation on the real numbers
    • OK
  • the trigonometric operations (sin x, cos x, tan x, cot x, csc x) on the real numbers
    • OK
  • the natural logarithm (ln x) on the real numbers
    • A logarithm requires a base, which is another operand. In this case, the base is e. Therefore, this has two operands, x and e.
  • the logarithm of base 10 (log x) on the real numbers
    • This requires two operands, x and 10.
  • logical negation on truth values
  • A unary operation on a given set S is nothing but a function SS, also called an endomorphism of S.
    • OK

Pointlessness 16:02, 17 April 2007 (UTC)

All the operations you consider not unary are special cases of binary operations. If one operand in a binary operation is fixed, we have a unary operation on the other operand. So while all these operations can be described by binary operations, the operations as described in the article are unary operations. The negation on real numbers in particular is a good example of this - while it is the same as multiplying by -1, it is quite natural to define this unary operation (taking the additive inverse) without having any notion of multiplication. JPD (talk) 16:25, 17 April 2007 (UTC)

How about the difference operator? Can it also be considered a unary operator? Cako 23:38, 10 October 2007 (UTC)

It can be described as unary, in the sense that it produces one function from a single other function. But operator is traditional nomenclature; I would call it a unary functional. Septentrionalis PMAnderson 02:23, 11 October 2007 (UTC)
"If one operand in a binary operation is fixed, we have a unary operation on the other operand."
Then it all becomes rather arbitrary. If x^n, loge(x), and log10(x) are unitary, you might as well say log4(x), 4throot(x), and 13+x are umitary. 75.118.170.35 (talk) 20:07, 31 March 2009 (UTC)

[edit] Usage of Incremental and Decremental operators

The output of the examples given is clearly wrong. Seth Arlington (talk) 15:25, 1 October 2008 (UTC)

Listen, I just checked the output of the code snippets in question for the 3rd or 4th time now using Borland Turbo C Version 2.01. I don't know which compiler you're using, but unless someone can convince me that there is an error in my compiler, I'm going to correct the article again. Ghettoblaster (talk) 19:42, 1 October 2008 (UTC)
Relying on the output of a single compiler is irresponsible. Seth Arlington (talk) 20:53, 1 October 2008 (UTC)
It appears that C99 leaves order of evaluation for arguments in function calls unspecified. The output of the examples is compiler-specific. It would be best to modify the examples as to avoid confusion. This is almost certainly why your compiler produces different results. Seth Arlington (talk) 21:50, 1 October 2008 (UTC)
What you just found out is already mentioned in the article, so your results are not more correct than the ones that were in the article before you changed it. Remember, these are just examples. I fail to see how your modifications to the examples help to avoid confusion. Ghettoblaster (talk) 23:00, 1 October 2008 (UTC)
"...already mentioned in the article..." Please take a look at the page's history. I am responsible for the text that explains order of evaluation. Additionally, I haven't made any modifications to the examples. Seth Arlington (talk) 23:17, 1 October 2008 (UTC)
I ment the output examples of course. Since there is no single "correct" output, there is no reason for modifying the article to contain the output that you got using your favourite compiler. I also think we should restore the information which compiler/version was used to get the example output. Ghettoblaster (talk) 23:24, 2 October 2008 (UTC)
As an alternative, we could also add the different output one gets using various compilers to the article so that it is possible to compare the different results. Ghettoblaster (talk) 23:29, 2 October 2008 (UTC)
Personal tools

Visit joltnews for the latest headlines
Visit bloit.com for company information
Geed Media does computer consulting on long island.
This page viewed times. See Logs