www.wikidata.de-de.nina.az
math h ist eine Header Datei in der Standard C Library der Programmiersprache C Sie wurde fur mathematische Funktionen entwickelt Die Programmiersprache C benutzt die Funktionen ebenfalls um die Kompatibilitat von C zu C zu gewahrleisten und deklariert sie in der Header Datei cmath dort ohne die Dateinamenserweiterung h verwendet Alle Funktionen die einen Winkel einlesen oder ausgeben arbeiten mit Radiant Die meisten Funktionen arbeiten mit Gleitkommazahlen Mathematische Funktionen die mit ganzzahligen Werten Integer arbeiten wie abv labs div oder ldiv sind stattdessen in der Header Datei stdlib h vertreten Inhaltsverzeichnis 1 Funktionen bis C95 2 C99 Funktionen 3 Beispiel 4 WeblinksFunktionen bis C95 BearbeitenIn den Normen bis einschliesslich C95 waren die folgenden Funktionen deklariert Name Beschreibung Mathematische Formulierungacos Arkuskosinus arccos x displaystyle arccos x nbsp asin Arkussinus arcsin x displaystyle arcsin x nbsp atan Arkustangens arctan x displaystyle arctan x nbsp atan2 Arkustangens mit zwei Argumenten atan2 y x displaystyle operatorname atan2 y x nbsp ceil Aufrundungsfunktion x displaystyle lceil x rceil nbsp cos Kosinus cos x displaystyle cos x nbsp cosh Kosinus hyperbolicus cosh x displaystyle cosh x nbsp exp Exponentialfunktion e x displaystyle e x nbsp fabs Betragsfunktion x displaystyle x nbsp floor Ganzteilfunktion x displaystyle lfloor x rfloor nbsp fmod Fuhrt die Modulo Funktion fur Gleitkommazahlen durch x mod y displaystyle x bmod y nbsp frexp Teilt eine Gleitkommazahl in Faktor und Potenz mit der Basis 2 aufldexp Multipliziert den ersten Parameter mit 2 um den zweiten Parameter potenziert x 2 y displaystyle x2 y nbsp log Naturlicher Logarithmus ln x displaystyle ln x nbsp log10 Logarithmus zur Basis 10 log 10 x displaystyle log 10 x nbsp modf Teilt eine Gleitkommazahl in zwei Zahlen auf vor und nach dem Kommapow Potenziert ersten mit dem zweiten Parameter x y displaystyle x y nbsp sin Sinus sin x displaystyle sin x nbsp sinh Sinus hyperbolicus sinh x displaystyle sinh x nbsp sqrt Quadratwurzel x displaystyle sqrt x nbsp tan Tangens tan x displaystyle tan x nbsp tanh Tangens hyperbolicus tanh x displaystyle tanh x nbsp C99 Funktionen BearbeitenMit der Norm C99 wurde math h um die folgenden Funktionen erweitert Name Beschreibung Mathematische Formulierungacosh Areakosinus hyperbolicus arcosh x displaystyle operatorname arcosh x nbsp asinh Areasinus hyperbolicus arsinh x displaystyle operatorname arsinh x nbsp atanh Areatangens hyperbolicus artanh x displaystyle operatorname artanh x nbsp cbrt Kubikwurzel x 3 displaystyle sqrt 3 x nbsp copysign i x i i y i gibt den Wert von x mit dem Vorzeichen von y zuruck x sgn y displaystyle x cdot operatorname sgn y nbsp erf Fehlerfunktion erf x displaystyle operatorname erf x nbsp erfc Gibt den Komplementarfehler von x zuruck erfc x displaystyle operatorname erfc x nbsp exp2 i x i Potenziert 2 mit dem ubergebenen Parameter 2 x displaystyle 2 x nbsp expm1 i x i Liefert den Wert von exp 1 zuruck e x 1 displaystyle e x 1 nbsp fdim i x i i y i Positive Differenz max 0 x y displaystyle max 0 x y nbsp fma i x i i y i i z i Multipliziert und Addiert x y z displaystyle xy z nbsp fmax i x i i y i Maximum max x y displaystyle max x y nbsp fmin i x i i y i Minimum min x y displaystyle min x y nbsp hypot i x i i y i Hypotenuse x 2 y 2 displaystyle sqrt x 2 y 2 nbsp ilogb wie logb gibt allerdings int zuruck int logb x lgamma Logarithmus der Gammafunktion ln G x displaystyle ln Gamma x nbsp llrint Rundungsfunktionlrint Rundungsfunktionllround Rundungsfunktionlround Rundungsfunktionlog1p i x i Naturlicher Logarithmus von 1 x ln 1 x displaystyle ln 1 x nbsp log2 Logarithmus zur Basis 2 lb x displaystyle operatorname lb x nbsp logb Liefert den ganzzahligen Exponenten einer Gleitkommazahl als Gleitkommazahl rint log F L T R A D I X x displaystyle operatorname rint log mathrm FLT RADIX x nbsp nan i s i Ein NaN erzeugen 0 0 displaystyle 0 0 nbsp nearbyint Rundet Gleitkommazahlen zum nachsten Integernextafter i x i i y i Gibt die nachst darstellbare Zahl nach x Richtung y zurucknexttoward i x i i y i Wie nextafter ausser dass y als long double ubergeben wirdremainder i x i i y i Rest einer Divisionremquo i x i i y i i p i Genauso wie remainder speichert jedoch den Quotienten als int als Ziel des Zeigers print Rundet je nach Rundungsmodus zum nachsten Integer gibt eine Gleitkommazahl zuruckround kaufmannische Rundungsfunktion x 0 5 displaystyle lfloor x 0 5 rfloor nbsp scalbln i x i i y i x FLT RADIXy y ist long x F L T R A D I X y displaystyle x cdot mathrm FLT RADIX y nbsp scalbn i x i i y i x FLT RADIXy y ist int x F L T R A D I X y displaystyle x cdot mathrm FLT RADIX y nbsp tgamma Gammafunktion G x displaystyle Gamma x nbsp trunc Beschneidet eine Gleitkommazahl d h rundet Richtung Null x x 0 x x lt 0 displaystyle begin cases lfloor x rfloor amp x geq 0 lceil x rceil amp x lt 0 end cases nbsp Beispiel Bearbeiten include lt stdio h gt include lt math h gt int main double a 5 b 4 double c pow a b printf f hoch f ist f n a b c Weblinks BearbeitenRationale for International Standard Programming Languages C PDF 898 kB Abgerufen am 4 September 2011 C99 Beschreibung auf cplusplus com englisch Dokumentation von math h auf dinkumware com Memento vom 21 Februar 2010 im Internet Archive Abgerufen von https de wikipedia org w index php title Math h amp oldid 238214655