Unary function

A unary function is a function that takes one argument. A unary operator belongs to a subset of unary functions, in that its range coincides with its domain.

Examples

The successor function, denoted , is a unary operator. Its domain and codomain are the natural numbers, its definition is as follows:

In many programming languages such as C, executing this operation is denoted by postfixing to the operand, i.e. the use of is equivalent to executing the assignment .

Many of the elementary functions are unary functions, in particular the trigonometric functions, logarithm with a pre-specified base, exponentiation to a pre-specified power or of a pre-specified base, and hyperbolic functions are unary.

gollark: Oh, those work fine, sure.
gollark: There was also a project for patching firmware for the built-in WiFi chipset of said other thing to allow monitor mode stuff. Unfortunately, this shipped with its own several year outdated gcc binaries and plugin for incomprehensible reasons?
gollark: Then, I just gave up and compiled it on my other thing with an older kernel, where it eventually worked.
gollark: I decided to look at the code in more detail. This was a mistake. It contained thousands of lines with minimally useful comments, for some reason its own implementation of hash tables (this is very C, I suppose), and apparently its own implementation of WiFi mesh things even though that should really be handled generically for any device.
gollark: After I was able to work through git's terrible CLI enough to make that work, and "fixed" some merge conflicts, it somehow compiled still, but upon plugging in the thing, hung things again. I had dmesg open, and apparently it was a page fault somehow in the code assigning names or something?

See also

References

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.