Tgmath.h: Difference between revisions

Content deleted Content added
Line 7:
== Type-generic macro ==
A type generic macro is something which allows calling a function whose type is determined by the type of argument in the macro. This means, for example, x is declared as an [[int (computer science)|int]] data type but [[tangent|tan]] has been called this way:<br />
<source lang="c"> tan((float)x)</source><br />
then this [[Expression (computer science)|expression]] will have a type [[floating point|float]]<ref>http://manpages.ubuntu.com/manpages/hardy/man7/tgmath.h.7posix.html</ref>.<br />
Also, if any one of the [[Parameter (computer programming)|parameters]] or [[Argument (computer science)|arguments]] of a type-generic macro is [[Complex number|complex]], it will call a complex function, otherwise a [[Real number|real]] function will be called. The type of function that is called, ultimately depends upon the final converted type of parameter.<ref>http://www.qnx.com/developers/docs/6.4.1/dinkum_en/c99/tgmath.html</ref>.