From 53db1330b49d0af9f68040cc5c1322aba15951b0 Mon Sep 17 00:00:00 2001 From: msingh2 Date: Thu, 16 Jun 2016 10:36:08 +0000 Subject: [PATCH 1/7] C Math Functions CheatSheet added --- .../cheat_sheets/json/cmath_functions.json | 165 ++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 share/goodie/cheat_sheets/json/cmath_functions.json diff --git a/share/goodie/cheat_sheets/json/cmath_functions.json b/share/goodie/cheat_sheets/json/cmath_functions.json new file mode 100644 index 00000000000..47845ce54ea --- /dev/null +++ b/share/goodie/cheat_sheets/json/cmath_functions.json @@ -0,0 +1,165 @@ +{ + "id": "cmath_functions_cheat_sheet", + "name": "C Math Functions", + "description": "Cheat Sheet for C Math Functions from math.h", + + "metadata": { + "sourceName": "gnu.org", + "sourceUrl" : "http://www.gnu.org/software/libc/manual/html_mono/libc.html" + }, + + "aliases": [ + "c math functions", + "c mathematics functions", + "c math", + "math.h" + ], + + "template_type": "reference", + + "section_order": [ + "Trignometric Functions", + "Inverse Trignometric Functions", + "Exponentiation and Logarithms", + "Hyperbolic Functions" + ], + + "sections": { + "Trignometric Functions": [ + { + "key": "double sin (double x)", + "val": "Returns the sine of x, where x is given in radians. The return value is in the range -1 to 1." + }, + { + "key": "double cos (double x)", + "val": "Returns the cosine of x, where x is given in radians. The return value is in the range -1 to 1." + }, + { + "key": "double tan (double x)", + "val": "Returns the tangent of x, where x is given in radians." + }, + { + "key": "void sincos (double x, double *sinx, double *cosx)", + "val": "Returns the sine of x in *sinx and the cosine of x in *cos, where x is given in radians." + }, + { + "key": "complex double csin (complex double z)", + "val": "Returns the complex sine of z." + }, + { + "key": "complex double ccos (complex double z)", + "val": "Returns the complex cosine of z." + }, + { + "key": "complex double ctan (complex double z)", + "val": "Returns the complex tangent of z." + } + ], + "Inverse Trignometric Functions": [ + { + "key": "double asin (double x)", + "val": "Returns the arc sine of x in radians. The return value is in the range -pi//2 to pi//2." + }, + { + "key": "double acos (double x)", + "val": "Returns the arc cosine of x in radians. The return value is in the range 0 to pi." + }, + { + "key": "double atan (double x)", + "val": "Returns the arc tangent of x in radians. The return is in the range -pi//2 to pi//2." + }, + { + "key": "double atan2 (double y, double x)", + "val": "Returns the arc tangent in radians of y/x based on the signs of both values to determine the correct quadrant. The return value is given in radians and is in the range -pi to pi, inclusive." + } + ], + "Exponentiation and Logarithms": [ + { + "key": "double exp (double x)", + "val": "Returns the value of e raised to the xth power." + }, + { + "key": "double exp2 (double x)", + "val": "Returns the value of 2 raised to the xth power." + }, + { + "key": "double exp10 (double x)", + "val": "Returns the value of 10 raised to the xth power." + }, + { + "key": "double log(double x)", + "val": "Returns the natural logarithm (base-e logarithm) of x." + }, + { + "key": "double log2 (double x)", + "val": "Returns the natural logarithm (base-2 logarithm) of x." + }, + { + "key": "double log10 (double x)", + "val": "Returns the common logarithm (base-10 logarithm) of x." + }, + { + "key": "double pow (double x, double y)", + "val": "Returns x raised to the power of y." + }, + { + "key": "double sqrt (double x)", + "val": "Returns the square root of x." + }, + { + "key": "double cbrt (double x)", + "val": "Returns the cube root of x." + } + ], + "Hyperbolic Functions": [ + { + "key": "double sinh (double x)", + "val": "Returns the hyperbolic sine of x." + }, + { + "key": "double cosh (double x)", + "val": "Returns the hyperbolic cosine of x." + }, + { + "key": "double tanh (double x)", + "val": "Returns the hyperbolic tangent of x." + }, + { + "key": "complex double csinh (complex double z)", + "val": "Returns the complex hyperbolic sine of z." + }, + { + "key": "complex double ccosh (complex double z)", + "val": "Returns the complex hyperbolic cosine of z." + }, + { + "key": "complex double ctanh (complex double z)", + "val": "Returns the complex hyperbolic tangent of z." + }, + { + "key": "double asinh (double x)", + "val": "Returns the inverse hyperbolic sine of x." + }, + { + "key": "double acosh (double x)", + "val": "Returns the inverse hyperbolic cosine of x." + }, + { + "key": "double atanh (double x)", + "val": "Returns the inverse hyperbolic tangent of x." + }, + { + "key": "complex double casinh (complex double z)", + "val": "Returns the inverse complex hyperbolic sine of z." + }, + { + "key": "complex double cacosh (complex double z)", + "val": "Return the inverse complex hyperbolic cosine of z." + }, + { + "key": "complex double catanh (complex double z)", + "val": "Return the inverse complex hyperbolic tangent of z." + } + ] + } +} From bdd945529c5f169411062fce8b6e0b6b40cd2e6c Mon Sep 17 00:00:00 2001 From: msingh2 Date: Thu, 16 Jun 2016 11:00:43 +0000 Subject: [PATCH 2/7] Fixes name for Travis Build --- .../json/{cmath_functions.json => c_math_functions.json} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename share/goodie/cheat_sheets/json/{cmath_functions.json => c_math_functions.json} (99%) diff --git a/share/goodie/cheat_sheets/json/cmath_functions.json b/share/goodie/cheat_sheets/json/c_math_functions.json similarity index 99% rename from share/goodie/cheat_sheets/json/cmath_functions.json rename to share/goodie/cheat_sheets/json/c_math_functions.json index 47845ce54ea..dce1dae7e68 100644 --- a/share/goodie/cheat_sheets/json/cmath_functions.json +++ b/share/goodie/cheat_sheets/json/c_math_functions.json @@ -1,5 +1,5 @@ { - "id": "cmath_functions_cheat_sheet", + "id": "c_math_functions_cheat_sheet", "name": "C Math Functions", "description": "Cheat Sheet for C Math Functions from math.h", From f91f96128dce2b475282e07c500137565cc51207 Mon Sep 17 00:00:00 2001 From: msingh2 Date: Thu, 16 Jun 2016 11:09:27 +0000 Subject: [PATCH 3/7] Another fix for Travis Build --- .../json/{c_math_functions.json => c-math-functions.json} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename share/goodie/cheat_sheets/json/{c_math_functions.json => c-math-functions.json} (98%) diff --git a/share/goodie/cheat_sheets/json/c_math_functions.json b/share/goodie/cheat_sheets/json/c-math-functions.json similarity index 98% rename from share/goodie/cheat_sheets/json/c_math_functions.json rename to share/goodie/cheat_sheets/json/c-math-functions.json index dce1dae7e68..2aadd438654 100644 --- a/share/goodie/cheat_sheets/json/c_math_functions.json +++ b/share/goodie/cheat_sheets/json/c-math-functions.json @@ -58,7 +58,7 @@ "Inverse Trignometric Functions": [ { "key": "double asin (double x)", - "val": "Returns the arc sine of x in radians. The return value is in the range -pi//2 to pi//2." + "val": "Returns the arc sine of x in radians. The return value is in the range -pi/2 to pi/2." }, { "key": "double acos (double x)", @@ -66,7 +66,7 @@ }, { "key": "double atan (double x)", - "val": "Returns the arc tangent of x in radians. The return is in the range -pi//2 to pi//2." + "val": "Returns the arc tangent of x in radians. The return is in the range -pi/2 to pi/2." }, { "key": "double atan2 (double y, double x)", From b504b0d92ec0f3cbe8c6fa25906aaf4911e4a0f0 Mon Sep 17 00:00:00 2001 From: msingh2 Date: Thu, 16 Jun 2016 14:56:37 +0000 Subject: [PATCH 4/7] Removed conflicting alias --- share/goodie/cheat_sheets/json/c-math-functions.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/c-math-functions.json b/share/goodie/cheat_sheets/json/c-math-functions.json index 2aadd438654..2ea915cb80c 100644 --- a/share/goodie/cheat_sheets/json/c-math-functions.json +++ b/share/goodie/cheat_sheets/json/c-math-functions.json @@ -9,9 +9,8 @@ }, "aliases": [ - "c math functions", "c mathematics functions", - "c math", + "math", "math.h" ], From 580c35566de4de6745802b4a0cb595d125c3f009 Mon Sep 17 00:00:00 2001 From: msingh2 Date: Thu, 16 Jun 2016 15:18:23 +0000 Subject: [PATCH 5/7] Removed generic alias --- share/goodie/cheat_sheets/json/c-math-functions.json | 1 - 1 file changed, 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/c-math-functions.json b/share/goodie/cheat_sheets/json/c-math-functions.json index 2ea915cb80c..674c4745480 100644 --- a/share/goodie/cheat_sheets/json/c-math-functions.json +++ b/share/goodie/cheat_sheets/json/c-math-functions.json @@ -10,7 +10,6 @@ "aliases": [ "c mathematics functions", - "math", "math.h" ], From 70176121379374d9ce3505cdbb319e1746779817 Mon Sep 17 00:00:00 2001 From: msingh2 Date: Fri, 17 Jun 2016 15:34:22 +0000 Subject: [PATCH 6/7] Fixes spacing issue --- share/goodie/cheat_sheets/json/c-math-functions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/goodie/cheat_sheets/json/c-math-functions.json b/share/goodie/cheat_sheets/json/c-math-functions.json index 674c4745480..72c4fdee7dd 100644 --- a/share/goodie/cheat_sheets/json/c-math-functions.json +++ b/share/goodie/cheat_sheets/json/c-math-functions.json @@ -85,7 +85,7 @@ "val": "Returns the value of 10 raised to the xth power." }, { - "key": "double log(double x)", + "key": "double log (double x)", "val": "Returns the natural logarithm (base-e logarithm) of x." }, { From f6b707096c2040dbef43009180c7626d35d2542a Mon Sep 17 00:00:00 2001 From: msingh2 Date: Thu, 23 Jun 2016 22:45:35 +0000 Subject: [PATCH 7/7] Adds more functions | Removes few complex header functions --- .../cheat_sheets/json/c-math-functions.json | 130 +++++++++++------- 1 file changed, 79 insertions(+), 51 deletions(-) diff --git a/share/goodie/cheat_sheets/json/c-math-functions.json b/share/goodie/cheat_sheets/json/c-math-functions.json index 72c4fdee7dd..30af300ad15 100644 --- a/share/goodie/cheat_sheets/json/c-math-functions.json +++ b/share/goodie/cheat_sheets/json/c-math-functions.json @@ -19,144 +19,172 @@ "Trignometric Functions", "Inverse Trignometric Functions", "Exponentiation and Logarithms", - "Hyperbolic Functions" + "Hyperbolic Functions", + "Rounding Functions", + "Remainder Functions", + "Normalization Functions", + "Absolute Value" ], "sections": { "Trignometric Functions": [ { "key": "double sin (double x)", - "val": "Returns the sine of x, where x is given in radians. The return value is in the range -1 to 1." + "val": "Returns the sine of x, where x is given in radians. The return value is in the range -1 to 1" }, { "key": "double cos (double x)", - "val": "Returns the cosine of x, where x is given in radians. The return value is in the range -1 to 1." + "val": "Returns the cosine of x, where x is given in radians. The return value is in the range -1 to 1" }, { "key": "double tan (double x)", - "val": "Returns the tangent of x, where x is given in radians." + "val": "Returns the tangent of x, where x is given in radians" }, { "key": "void sincos (double x, double *sinx, double *cosx)", - "val": "Returns the sine of x in *sinx and the cosine of x in *cos, where x is given in radians." - }, - { - "key": "complex double csin (complex double z)", - "val": "Returns the complex sine of z." - }, - { - "key": "complex double ccos (complex double z)", - "val": "Returns the complex cosine of z." - }, - { - "key": "complex double ctan (complex double z)", - "val": "Returns the complex tangent of z." + "val": "Returns the sine of x in *sinx and the cosine of x in *cos, where x is given in radians" } ], "Inverse Trignometric Functions": [ { "key": "double asin (double x)", - "val": "Returns the arc sine of x in radians. The return value is in the range -pi/2 to pi/2." + "val": "Returns the arc sine of x in radians. The return value is in the range -pi/2 to pi/2" }, { "key": "double acos (double x)", - "val": "Returns the arc cosine of x in radians. The return value is in the range 0 to pi." + "val": "Returns the arc cosine of x in radians. The return value is in the range 0 to pi" }, { "key": "double atan (double x)", - "val": "Returns the arc tangent of x in radians. The return is in the range -pi/2 to pi/2." + "val": "Returns the arc tangent of x in radians. The return is in the range -pi/2 to pi/2" }, { "key": "double atan2 (double y, double x)", - "val": "Returns the arc tangent in radians of y/x based on the signs of both values to determine the correct quadrant. The return value is given in radians and is in the range -pi to pi, inclusive." + "val": "Returns the arc tangent in radians of y/x based on the signs of both values to determine the correct quadrant. The return value is given in radians and is in the range -pi to pi, inclusive" } ], "Exponentiation and Logarithms": [ { "key": "double exp (double x)", - "val": "Returns the value of e raised to the xth power." + "val": "Returns the value of e raised to the xth power" }, { "key": "double exp2 (double x)", - "val": "Returns the value of 2 raised to the xth power." + "val": "Returns the value of 2 raised to the xth power" }, { "key": "double exp10 (double x)", - "val": "Returns the value of 10 raised to the xth power." + "val": "Returns the value of 10 raised to the xth power" }, { "key": "double log (double x)", - "val": "Returns the natural logarithm (base-e logarithm) of x." + "val": "Returns the natural logarithm (base-e logarithm) of x" }, { "key": "double log2 (double x)", - "val": "Returns the natural logarithm (base-2 logarithm) of x." + "val": "Returns the natural logarithm (base-2 logarithm) of x" }, { "key": "double log10 (double x)", - "val": "Returns the common logarithm (base-10 logarithm) of x." + "val": "Returns the common logarithm (base-10 logarithm) of x" }, { "key": "double pow (double x, double y)", - "val": "Returns x raised to the power of y." + "val": "Returns x raised to the power of y" }, { "key": "double sqrt (double x)", - "val": "Returns the square root of x." + "val": "Returns the square root of x" }, { "key": "double cbrt (double x)", - "val": "Returns the cube root of x." + "val": "Returns the cube root of x" } ], "Hyperbolic Functions": [ { "key": "double sinh (double x)", - "val": "Returns the hyperbolic sine of x." + "val": "Returns the hyperbolic sine of x" }, { "key": "double cosh (double x)", - "val": "Returns the hyperbolic cosine of x." + "val": "Returns the hyperbolic cosine of x" }, { "key": "double tanh (double x)", - "val": "Returns the hyperbolic tangent of x." + "val": "Returns the hyperbolic tangent of x" }, { - "key": "complex double csinh (complex double z)", - "val": "Returns the complex hyperbolic sine of z." + "key": "double asinh (double x)", + "val": "Returns the inverse hyperbolic sine of x" }, { - "key": "complex double ccosh (complex double z)", - "val": "Returns the complex hyperbolic cosine of z." + "key": "double acosh (double x)", + "val": "Returns the inverse hyperbolic cosine of x" }, { - "key": "complex double ctanh (complex double z)", - "val": "Returns the complex hyperbolic tangent of z." + "key": "double atanh (double x)", + "val": "Returns the inverse hyperbolic tangent of x" + } + ], + "Rounding Functions": [ + { + "key": "double ceil (double x)", + "val": "Rounds x upwards to the nearest integer, returning that value as a double" }, { - "key": "double asinh (double x)", - "val": "Returns the inverse hyperbolic sine of x." + "key": "double floor (double x)", + "val": "Rounds x downwards to the nearest integer, returning that value as a double" }, { - "key": "double acosh (double x)", - "val": "Returns the inverse hyperbolic cosine of x." + "key": "double trunc (double x)", + "val": "Round x towards zero to the nearest integer (returned in floating-point format)" }, { - "key": "double atanh (double x)", - "val": "Returns the inverse hyperbolic tangent of x." + "key": "double rint (double x)", + "val": "Round x to an integer value according to the current rounding mode" }, { - "key": "complex double casinh (complex double z)", - "val": "Returns the inverse complex hyperbolic sine of z." + "key": "double nearbyint (double x)", + "val": "Returns the same value as the rint functions, but do not raise the inexact exception if x is not an integer" }, { - "key": "complex double cacosh (complex double z)", - "val": "Return the inverse complex hyperbolic cosine of z." + "key": "double round (double x)", + "val": "Similar to rint, but they round halfway cases away from zero instead of to the nearest integer (or other current rounding mode)" }, { - "key": "complex double catanh (complex double z)", - "val": "Return the inverse complex hyperbolic tangent of z." + "key": "double modf (double value, double *integer-part)", + "val": "Breaks the argument value into an integer part and a fractional part (between -1 and 1, exclusive). Their sum equals value" + } + ], + "Remainder Functions": [ + { + "key": "double fmod (double numerator, double denominator)", + "val": "Computes the remainder from the division of numerator by denominator" + }, + { + "key": "double drem (double numerator, double denominator)", + "val": "Like fmod except it rounds the internal quotient n to the nearest integer instead of towards zero to an integer" + }, + { + "key": "double remainder (double numerator, double denominator)", + "val": "Another name for drem" + } + ], + "Normalization Functions": [ + { + "key": "double frexp (double value, int *exponent)", + "val": "To split the number value into a normalized fraction and an exponent" + }, + { + "key": "double ldexp (double value, int exponent)", + "val": "Returns the result of multiplying the floating-point number value by 2 raised to the power exponent" + } + ], + "Absolute Value": [ + { + "key": "double fabs (double number)", + "val": "Returns the absolute value of the floating-point number number" } ] }