HOME WEB NEWS IMAGES CLASSIFIEDS YELLOW PAGESPOLLS - SURVEYS WIKI COUNTRIES PHOTOS US UK INDIA
Avoo.com provides meta search results from various sources

Unary_operation


Google



1

In mathematics, a unary operation is an operation with only one operand, i.e. an operation with a single input, or in other words, a function of one variable (for the terminology see also operators versus functions).

Common notations are prefix notation (+, −, not), postfix notation (factorial: n!), and functional notation (sin x or sin (x)). In the case of the square root a horizontal bar over the argument extending the square root sign can indicate the extent of the argument, so that parentheses can be dispensed with.

Contents

Examples of Unary Operations


Computer Programming

Unary operators (called "monadic" in APL) are also used in programming languages. For example, in the C family of languages, the following operators are unary:

Usage of Incremental and Decremental Operators

In most programming languages, incremental and decremental operators can be preffixed and suffixed to the variable. The preffix and suffix can be useful when manipulating variables. A suffixed operation increments the value after it has been called.

Example 1

int i = 0;
printf (" %i \n %i ", i++ , i++ );
Output:
0
1

Whereas a prefixed operation will increment the value before it has been called.

Example 2

int i = 0;
printf (" %i \n %i ", ++i, ++i);
Output
1
2
The usage of incremental and decremental operators is usually found in For loops

See also

This article is licensed under the GNU Free Documentation License. It uses material from Wikipedia


Advertise with Us | Search Marketing | Help | Suggest a Site | Privacy Policy
© 2008 www.avoo.com. All rights reserved.