[gnumeric] convert fn-eng
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnumeric] convert fn-eng
- Date: Wed, 1 Jul 2009 20:25:50 +0000 (UTC)
commit 7d51708e24f2a70ddc3d7adbc232536b83943aec
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date: Wed Jul 1 14:25:24 2009 -0600
convert fn-eng
2009-07-01 Andreas J. Guelzow <aguelzow pyrshep ca>
* functions.c: conversion to new function description
plugins/fn-eng/ChangeLog | 4 +
plugins/fn-eng/functions.c | 969 +++++++++++++++++---------------------------
2 files changed, 374 insertions(+), 599 deletions(-)
---
diff --git a/plugins/fn-eng/ChangeLog b/plugins/fn-eng/ChangeLog
index 6866740..c10c953 100644
--- a/plugins/fn-eng/ChangeLog
+++ b/plugins/fn-eng/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-01 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * functions.c: conversion to new function description
+
2009-06-20 Morten Welinder <terra gnome org>
* Release 1.9.9
diff --git a/plugins/fn-eng/functions.c b/plugins/fn-eng/functions.c
index a5e788c..e81101d 100644
--- a/plugins/fn-eng/functions.c
+++ b/plugins/fn-eng/functions.c
@@ -201,25 +201,16 @@ val_to_base (GnmFuncEvalInfo *ei,
/***************************************************************************/
static GnmFuncHelp const help_base[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=BASE\n"
- "@SYNTAX=BASE(number,base[,length])\n"
-
- "@DESCRIPTION="
- "BASE function converts a number to a string representing that number "
- "in base @base.\n"
- "\n"
- "* @base must be an integer between 2 and 36.\n"
- "* This function is OpenOffice.Org compatible.\n"
- "* Optional argument @length specifies the minimum result length. Leading "
- " zeroes will be added to reach this length.\n"
- "\n"
- "@EXAMPLES=\n"
- "BASE(255,16,4) equals \"00FF\".\n"
- "\n"
- "@SEEALSO=DECIMAL")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("BASE:string of digits representing the number @{n} in base @{b}") },
+ { GNM_FUNC_HELP_ARG, F_("n:integer") },
+ { GNM_FUNC_HELP_ARG, F_("b:base (2 \xe2\x89\xa4 @{b} \xe2\x89\xa4 36)") },
+ { GNM_FUNC_HELP_ARG, F_("length:minimum length of the resutling string") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("BASE converts @{n} to its string representation in base @{b}."
+ " Leading zeroes will be added to reach the minimum length given by @{length}.") },
+ { GNM_FUNC_HELP_ODF, F_("This function is OpenFormula compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=BASE(255,16,4)" },
+ { GNM_FUNC_HELP_SEEALSO, "DECIMAL" },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -239,21 +230,12 @@ gnumeric_base (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_bin2dec[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=BIN2DEC\n"
- "@SYNTAX=BIN2DEC(x)\n"
-
- "@DESCRIPTION="
- "BIN2DEC function converts a binary number "
- "in string or number to its decimal equivalent.\n\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "BIN2DEC(101) equals 5.\n"
- "\n"
- "@SEEALSO=DEC2BIN, BIN2OCT, BIN2HEX")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("BIN2DEC:decimal representation of the binary number @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("x:a binary number, either as a string or as a number involving only the digits 0 and 1") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=BIN2DEC(101)" },
+ { GNM_FUNC_HELP_SEEALSO, "DEC2BIN,BIN2OCT,BIN2HEX" },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -270,24 +252,16 @@ gnumeric_bin2dec (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_bin2oct[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=BIN2OCT\n"
- "@SYNTAX=BIN2OCT(number[,places])\n"
-
- "@DESCRIPTION="
- "BIN2OCT function converts a binary number to an octal number. "
- "@places is an optional field, specifying to zero pad to that "
- "number of spaces.\n"
- "\n"
- "* If @places is too small or negative #NUM! error is returned.\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "BIN2OCT(110111) equals 67.\n"
- "\n"
- "@SEEALSO=OCT2BIN, BIN2DEC, BIN2HEX")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("BIN2OCT: octal representation of the binary number @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("x:a binary number, either as a string or as a number involving only the digits 0 and 1") },
+ { GNM_FUNC_HELP_ARG, F_("places:number of digits") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("If @{places} is given, BIN2OCT pads the result with zeros to achieve "
+ "exactly @{places} digits. If this is not possible, BIN2OCT returns #NUM!") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=BIN2OCT(110111)" },
+ { GNM_FUNC_HELP_EXAMPLES, "=BIN2OCT(110111,4)" },
+ { GNM_FUNC_HELP_SEEALSO, ("OCT2BIN,BIN2DEC,BIN2HEX") },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -302,26 +276,19 @@ gnumeric_bin2oct (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_bin2hex[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=BIN2HEX\n"
- "@SYNTAX=BIN2HEX(number[,places])\n"
-
- "@DESCRIPTION="
- "BIN2HEX function converts a binary number to a "
- "hexadecimal number. @places is an optional field, specifying "
- "to zero pad to that number of spaces.\n"
- "\n"
- "* If @places is too small or negative #NUM! error is returned.\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "BIN2HEX(100111) equals 27.\n"
- "\n"
- "@SEEALSO=HEX2BIN, BIN2OCT, BIN2DEC")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("BIN2HEX: hexadecimal representation of the binary number @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("x:a binary number, either as a string or as a number involving only the digits 0 and 1") },
+ { GNM_FUNC_HELP_ARG, F_("places:number of digits") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("If @{places} is given, BIN2HEX pads the result with zeros to achieve "
+ "exactly @{places} digits. If this is not possible, BIN2HEX returns #NUM!") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=BIN2HEX(100111)" },
+ { GNM_FUNC_HELP_EXAMPLES, "=BIN2HEX(110111,4)" },
+ { GNM_FUNC_HELP_SEEALSO, ("HEX2BIN,BIN2OCT,BIN2DEC") },
+ { GNM_FUNC_HELP_END}
};
+
static GnmValue *
gnumeric_bin2hex (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
@@ -334,26 +301,18 @@ gnumeric_bin2hex (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_dec2bin[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=DEC2BIN\n"
- "@SYNTAX=DEC2BIN(number[,places])\n"
-
- "@DESCRIPTION="
- "DEC2BIN function converts a decimal number to a binary number. "
- "@places is an optional field, specifying to zero pad to that "
- "number of spaces.\n"
- "\n"
- "* If @places is too small or negative #NUM! error is returned.\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "DEC2BIN(42) equals 101010.\n"
- "\n"
- "@SEEALSO=BIN2DEC, DEC2OCT, DEC2HEX")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("DEC2BIN: binary representation of the decimal number @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("x:integer") },
+ { GNM_FUNC_HELP_ARG, F_("places:number of digits") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("If @{places} is given, DEC2BIN pads the result with zeros to achieve "
+ "exactly @{places} digits. If this is not possible, DEC2BIN returns #NUM!") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=DEC2BIN(42)" },
+ { GNM_FUNC_HELP_SEEALSO, ("BIN2DEC,DEC2OCT,DEC2HEX") },
+ { GNM_FUNC_HELP_END}
};
+
static GnmValue *
gnumeric_dec2bin (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
@@ -366,24 +325,15 @@ gnumeric_dec2bin (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_dec2oct[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=DEC2OCT\n"
- "@SYNTAX=DEC2OCT(number[,places])\n"
-
- "@DESCRIPTION="
- "DEC2OCT function converts a decimal number to an octal number. "
- "@places is an optional field, specifying to zero pad to that "
- "number of spaces.\n"
- "\n"
- "* If @places is too small or negative #NUM! error is returned.\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "DEC2OCT(42) equals 52.\n"
- "\n"
- "@SEEALSO=OCT2DEC, DEC2BIN, DEC2HEX")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("DEC2OCT: octal representation of the decimal number @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("x:integer") },
+ { GNM_FUNC_HELP_ARG, F_("places:number of digits") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("If @{places} is given, DEC2OCT pads the result with zeros to achieve "
+ "exactly @{places} digits. If this is not possible, DEC2OCT returns #NUM!") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=DEC2OCT(42)" },
+ { GNM_FUNC_HELP_SEEALSO, ("OCT2DEC,DEC2BIN,DEC2HEX") },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -398,24 +348,15 @@ gnumeric_dec2oct (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_dec2hex[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=DEC2HEX\n"
- "@SYNTAX=DEC2HEX(number[,places])\n"
-
- "@DESCRIPTION="
- "DEC2HEX function converts a decimal number to a hexadecimal "
- "number. @places is an optional field, specifying to zero pad "
- "to that number of spaces.\n"
- "\n"
- "* If @places is too small or negative #NUM! error is returned.\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "DEC2HEX(42) equals 2A.\n"
- "\n"
- "@SEEALSO=HEX2DEC, DEC2BIN, DEC2OCT")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("DEC2HEX: hexadecimal representation of the decimal number @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("x:integer") },
+ { GNM_FUNC_HELP_ARG, F_("places:number of digits") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("If @{places} is given, DEC2HEX pads the result with zeros to achieve "
+ "exactly @{places} digits. If this is not possible, DEC2HEX returns #NUM!") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=DEC2HEX(42)" },
+ { GNM_FUNC_HELP_SEEALSO, ("HEX2DEC,DEC2BIN,DEC2OCT") },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -430,22 +371,14 @@ gnumeric_dec2hex (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_decimal[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=DECIMAL\n"
- "@SYNTAX=DECIMAL(text,base)\n"
-
- "@DESCRIPTION="
- "DECIMAL function converts a number in base @base to decimal.\n"
- "\n"
- "* @base must be an integer between 2 and 36.\n"
- "* This function is OpenOffice.Org compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "DECIMAL(\"A1\",16) equals 161.\n"
- "\n"
- "@SEEALSO=BASE")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("DECIMAL:decimal representation of @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("x:number in base @{base}") },
+ { GNM_FUNC_HELP_ARG, F_("base:base of @{x}, (2 \xe2\x89\xa4 @{b} \xe2\x89\xa4 36)") },
+ { GNM_FUNC_HELP_ODF, F_("This function is OpenFormula compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=DECIMAL(\"A1\",16)" },
+ { GNM_FUNC_HELP_EXAMPLES, "=DECIMAL(\"A1\",15)" },
+ { GNM_FUNC_HELP_SEEALSO, "BASE" },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -462,23 +395,16 @@ gnumeric_decimal (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_oct2dec[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=OCT2DEC\n"
- "@SYNTAX=OCT2DEC(x)\n"
-
- "@DESCRIPTION="
- "OCT2DEC function converts an octal number "
- "in a string or number to its decimal equivalent.\n\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "OCT2DEC(\"124\") equals 84.\n"
- "\n"
- "@SEEALSO=DEC2OCT, OCT2BIN, OCT2HEX")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("BIN2DEC:decimal representation of the octal number @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("x:a octal number, either as a string or as a number") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=OCT2DEC(\"124\")" },
+ { GNM_FUNC_HELP_EXAMPLES, "=OCT2DEC(124)" },
+ { GNM_FUNC_HELP_SEEALSO, ("DEC2OCT,OCT2BIN,OCT2HEX") },
+ { GNM_FUNC_HELP_END}
};
+
static GnmValue *
gnumeric_oct2dec (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
@@ -493,24 +419,15 @@ gnumeric_oct2dec (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_oct2bin[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=OCT2BIN\n"
- "@SYNTAX=OCT2BIN(number[,places])\n"
-
- "@DESCRIPTION="
- "OCT2BIN function converts an octal number to a binary "
- "number. @places is an optional field, specifying to zero pad "
- "to that number of spaces.\n"
- "\n"
- "* If @places is too small or negative #NUM! error is returned.\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "OCT2BIN(\"213\") equals 10001011.\n"
- "\n"
- "@SEEALSO=BIN2OCT, OCT2DEC, OCT2HEX")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("OCT2BIN:binary representation of the octal number @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("x:a octal number, either as a string or as a number") },
+ { GNM_FUNC_HELP_ARG, F_("places:number of digits") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("If @{places} is given, OCT2BIN pads the result with zeros to achieve "
+ "exactly @{places} digits. If this is not possible, OCT2BIN returns #NUM!") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=OCT2BIN(\"213\")" },
+ { GNM_FUNC_HELP_SEEALSO, ("BIN2OCT,OCT2DEC,OCT2HEX") },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -525,24 +442,15 @@ gnumeric_oct2bin (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_oct2hex[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=OCT2HEX\n"
- "@SYNTAX=OCT2HEX(number[,places])\n"
-
- "@DESCRIPTION="
- "OCT2HEX function converts an octal number to a hexadecimal "
- "number. @places is an optional field, specifying to zero pad "
- "to that number of spaces.\n"
- "\n"
- "* If @places is too small or negative #NUM! error is returned.\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "OCT2HEX(132) equals 5A.\n"
- "\n"
- "@SEEALSO=HEX2OCT, OCT2BIN, OCT2DEC")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("OCT2HEX:hexadecimal representation of the octal number @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("x:a octal number, either as a string or as a number") },
+ { GNM_FUNC_HELP_ARG, F_("places:number of digits") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("If @{places} is given, OCT2HEX pads the result with zeros to achieve "
+ "exactly @{places} digits. If this is not possible, OCT2HEX returns #NUM!") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=OCT2HEX(132)" },
+ { GNM_FUNC_HELP_SEEALSO, ("HEX2OCT,OCT2BIN,OCT2DEC") },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -557,24 +465,15 @@ gnumeric_oct2hex (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_hex2bin[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=HEX2BIN\n"
- "@SYNTAX=HEX2BIN(number[,places])\n"
-
- "@DESCRIPTION="
- "HEX2BIN function converts a hexadecimal number to a binary "
- "number. @places is an optional field, specifying to zero pad "
- "to that number of spaces.\n"
- "\n"
- "* If @places is too small or negative #NUM! error is returned.\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "HEX2BIN(\"2A\") equals 101010.\n"
- "\n"
- "@SEEALSO=BIN2HEX, HEX2OCT, HEX2DEC")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("HEX2BIN:binary representation of the hexadecimalal number @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("x:a hexadecimal number, either as a string or as a number if no A to F are needed") },
+ { GNM_FUNC_HELP_ARG, F_("places:number of digits") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("If @{places} is given, HEX2BIN pads the result with zeros to achieve "
+ "exactly @{places} digits. If this is not possible, HEX2BIN returns #NUM!") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=HEX2BIN(\"2A\")" },
+ { GNM_FUNC_HELP_SEEALSO, ("BIN2HEX,HEX2OCT,HEX2DEC") },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -589,24 +488,15 @@ gnumeric_hex2bin (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_hex2oct[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=HEX2OCT\n"
- "@SYNTAX=HEX2OCT(number[,places])\n"
-
- "@DESCRIPTION="
- "HEX2OCT function converts a hexadecimal number to an octal "
- "number. @places is an optional field, specifying to zero pad "
- "to that number of spaces.\n"
- "\n"
- "* If @places is too small or negative #NUM! error is returned.\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "HEX2OCT(\"2A\") equals 52.\n"
- "\n"
- "@SEEALSO=OCT2HEX, HEX2BIN, HEX2DEC")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("HEX2OCT:octal representation of the hexadecimal number @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("x:a hexadecimal number, either as a string or as a number if no A to F are needed") },
+ { GNM_FUNC_HELP_ARG, F_("places:number of digits") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("If @{places} is given, HEX2OCT pads the result with zeros to achieve "
+ "exactly @{places} digits. If this is not possible, HEX2OCT returns #NUM!") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=HEX2OCT(\"2A\")" },
+ { GNM_FUNC_HELP_SEEALSO, ("OCT2HEX,HEX2BIN,HEX2DEC") },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -621,21 +511,15 @@ gnumeric_hex2oct (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_hex2dec[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=HEX2DEC\n"
- "@SYNTAX=HEX2DEC(x)\n"
-
- "@DESCRIPTION="
- "HEX2DEC function converts a hexadecimal number "
- "to its decimal equivalent.\n\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "HEX2DEC(\"2A\") equals 42.\n"
- "\n"
- "@SEEALSO=DEC2HEX, HEX2BIN, HEX2OCT")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("HEX2DEC:decimal representation of the hexadecimal number @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("x:a hexadecimal number, either as a string or as a number if no A to F are needed") },
+ { GNM_FUNC_HELP_ARG, F_("places:number of digits") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("If @{places} is given, HEX2DEC pads the result with zeros to achieve "
+ "exactly @{places} digits. If this is not possible, HEX2DEC returns #NUM!") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=HEX2DEC(\"2A\")" },
+ { GNM_FUNC_HELP_SEEALSO, ("DEC2HEX,HEX2BIN,HEX2OCT") },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -652,30 +536,17 @@ gnumeric_hex2dec (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_besseli[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=BESSELI\n"
- "@SYNTAX=BESSELI(x,y)\n"
-
- "@DESCRIPTION="
- "BESSELI function returns the Neumann, Weber or Bessel "
- "function.\n\n"
- "@x is where the function is evaluated. "
- "@y is the order of the Bessel function.\n"
- "\n"
- "* If @x or @y are not numeric a #VALUE! error is returned.\n"
- "* If @y < 0 a #NUM! error is returned.\n"
- "* This function extends the Excel function of the same name to "
- "non-integer orders.\n"
- "\n"
- "@EXAMPLES=\n"
- "BESSELI(0.7,3) equals 0.007367374.\n"
- "\n"
- "@SEEALSO=BESSELJ,BESSELK,BESSELY")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("BESSELI:Modified Bessel function of the first kind of order @{\xce\xb1} at @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("X:number") },
+ { GNM_FUNC_HELP_ARG, F_("\xce\xb1:order (any number)") },
+ { GNM_FUNC_HELP_NOTE, F_("If @{x} or @{\xce\xb1} are not numeric, #VALUE! is returned. If @{\xce\xb1} < 0, #NUM! is returned.") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible if only integer orders @{\xce\xb1} are used.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=BESSELI(0.7,3)" },
+ { GNM_FUNC_HELP_SEEALSO, "BESSELJ,BESSELK,BESSELY" },
+ { GNM_FUNC_HELP_EXTREF, F_("wiki:en:Bessel_function") },
+ { GNM_FUNC_HELP_END}
};
-
static GnmValue *
gnumeric_besseli (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
@@ -703,29 +574,18 @@ gnumeric_besseli (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_besselk[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=BESSELK\n"
- "@SYNTAX=BESSELK(x,y)\n"
-
- "@DESCRIPTION="
- "BESSELK function returns the Neumann, Weber or Bessel "
- "function. "
- "@x is where the function is evaluated. "
- "@y is the order of the Bessel function.\n"
- "\n"
- "* If @x or @y are not numeric a #VALUE! error is returned.\n"
- "* If @y < 0 a #NUM! error is returned.\n"
- "* This function extends the Excel function of the same name to "
- "non-integer orders.\n"
- "\n"
- "@EXAMPLES=\n"
- "BESSELK(3,9) equals 397.95880.\n"
- "\n"
- "@SEEALSO=BESSELI,BESSELJ,BESSELY")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("BESSELK:Modified Bessel function of the second kind of order @{\xce\xb1} at @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("X:number") },
+ { GNM_FUNC_HELP_ARG, F_("\xce\xb1:order (any number)") },
+ { GNM_FUNC_HELP_NOTE, F_("If @{x} or @{\xce\xb1} are not numeric, #VALUE! is returned. If @{\xce\xb1} < 0, #NUM! is returned.") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible if only integer orders @{\xce\xb1} are used.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=BESSELK(3,9)" },
+ { GNM_FUNC_HELP_SEEALSO, "BESSELI,BESSELJ,BESSELY" },
+ { GNM_FUNC_HELP_EXTREF, F_("wiki:en:Bessel_function") },
+ { GNM_FUNC_HELP_END}
};
+
static GnmValue *
gnumeric_besselk (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
@@ -738,26 +598,17 @@ gnumeric_besselk (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_besselj[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=BESSELJ\n"
- "@SYNTAX=BESSELJ(x,y)\n"
-
- "@DESCRIPTION="
- "BESSELJ function returns the Bessel function with "
- "@x is where the function is evaluated. "
- "@y is the order of the Bessel function, if non-integer it is "
- "truncated.\n"
- "\n"
- "* If @x or @y are not numeric a #VALUE! error is returned.\n"
- "* If @y < 0 a #NUM! error is returned.\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "BESSELJ(0.89,3) equals 0.013974004.\n"
- "\n"
- "@SEEALSO=BESSELI,BESSELK,BESSELY")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("BESSELJ:Bessel functionn of the first kind of order @{\xce\xb1} at @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("X:number") },
+ { GNM_FUNC_HELP_ARG, F_("\xce\xb1:order (any non-negative integer)") },
+ { GNM_FUNC_HELP_NOTE, F_("If @{x} or @{\xce\xb1} are not numeric, #VALUE! is returned. "
+ "If @{\xce\xb1} < 0, #NUM! is returned. "
+ "If @{\xce\xb1} is not an integer, it is truncated.") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=BESSELJ(0.89,3)" },
+ { GNM_FUNC_HELP_SEEALSO, "BESSELI,BESSELK,BESSELY" },
+ { GNM_FUNC_HELP_EXTREF, F_("wiki:en:Bessel_function") },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -776,27 +627,16 @@ gnumeric_besselj (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_bessely[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=BESSELY\n"
- "@SYNTAX=BESSELY(x,y)\n"
-
- "@DESCRIPTION="
- "BESSELY function returns the Neumann, Weber or Bessel "
- "function.\n\n"
- "@x is where the function is evaluated. "
- "@y is the order of the Bessel function, if non-integer it is "
- "truncated.\n"
- "\n"
- "* If @x or @y are not numeric a #VALUE! error is returned.\n"
- "* If @y < 0 a #NUM! error is returned.\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "BESSELY(4,2) equals 0.215903595.\n"
- "\n"
- "@SEEALSO=BESSELI,BESSELJ,BESSELK")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("BESSELJ:Bessel functionn of the second kind of order @{\xce\xb1} at @{x}") },
+ { GNM_FUNC_HELP_ARG, F_("X:number") },
+ { GNM_FUNC_HELP_ARG, F_("\xce\xb1:order (any non-negative integer)") },
+ { GNM_FUNC_HELP_NOTE, F_("If @{x} or @{\xce\xb1} are not numeric, #VALUE! is returned. "
+ "If @{\xce\xb1} < 0, #NUM! is returned. "
+ "If @{\xce\xb1} is not an integer, it is truncated.") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=BESSELY(4,2)" },
+ { GNM_FUNC_HELP_SEEALSO, "BESSELI,BESSELJ,BESSELK" },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -813,114 +653,99 @@ gnumeric_bessely (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
-/* FIXME: "deka" is US-centric. The official SI prefix is "deca" (see
- * http://en.wikipedia.org/wiki/SI_unit and
- * http://en.wikipedia.org/wiki/SI_prefix) */
-
static GnmFuncHelp const help_convert[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=CONVERT\n"
- "@SYNTAX=CONVERT(number,from_unit,to_unit)\n"
- "@DESCRIPTION="
- "CONVERT returns a conversion from one measurement system to "
- "another. For example, you can convert a weight in pounds "
- "to a weight in grams. @number is the value you want to "
- "convert, @from_unit specifies the unit of the @number, and "
- "@to_unit is the unit for the result.\n"
- "\n"
- "@from_unit and @to_unit can be any of the following:\n\n"
- "Weight and mass:\n"
- "\t'g' \t\tGram\n"
- "\t'sg' \t\tSlug\n"
- "\t'lbm'\t\tPound\n"
- "\t'u' \t\tU (atomic mass)\n"
- "\t'ozm'\t\tOunce\n\n"
- "Distance:\n"
- "\t'm' \t\tMeter\n"
- "\t'mi' \t\tStatute mile\n"
- "\t'Nmi' \t\tNautical mile\n"
- "\t'in' \t\tInch\n"
- "\t'ft' \t\tFoot\n"
- "\t'yd' \t\tYard\n"
- "\t'ang' \t\tAngstrom\n"
- "\t'Pica'\t\tPica\n\n"
- "Time:\n"
- "\t'yr' \t\tYear\n"
- "\t'day' \t\tDay\n"
- "\t'hr' \t\tHour\n"
- "\t'mn' \t\tMinute\n"
- "\t'sec' \t\tSecond\n\n"
- "Pressure:\n"
- "\t'Pa' \t\tPascal\n"
- "\t'atm' \t\tAtmosphere\n"
- "\t'mmHg'\tmm of Mercury\n\n"
- "Force:\n"
- "\t'N' \t\tNewton\n"
- "\t'dyn' \t\tDyne\n"
- "\t'lbf' \t\tPound force\n\n"
- "Energy:\n"
- "\t'J' \t\tJoule\n"
- "\t'e' \t\tErg\n"
- "\t'c' \t\tThermodynamic calorie\n"
- "\t'cal' \t\tIT calorie\n"
- "\t'eV' \tElectron volt\n"
- "\t'HPh' \tHorsepower-hour\n"
- "\t'Wh' \tWatt-hour\n"
- "\t'flb' \t\tFoot-pound\n"
- "\t'BTU' \tBTU\n\n"
- "Power:\n"
- "\t'HP' \tHorsepower\n"
- "\t'W' \tWatt\n\n"
- "Magnetism:\n"
- "\t'T' \t\tTesla\n"
- "\t'ga' \tGauss\n\n"
- "Temperature:\n"
- "\t'C' \t\tDegree Celsius\n"
- "\t'F' \t\tDegree Fahrenheit\n"
- "\t'K' \t\tDegree Kelvin\n\n"
- "Liquid measure:\n"
- "\t'tsp' \t\tTeaspoon\n"
- "\t'tbs' \t\tTablespoon\n"
- "\t'oz' \t\tFluid ounce\n"
- "\t'cup' \tCup\n"
- "\t'pt' \t\tPint\n"
- "\t'qt' \t\tQuart\n"
- "\t'gal' \t\tGallon\n"
- "\t'l' \t\tLiter\n\n"
- "For metric units any of the following prefixes can be used:\n"
- "\t'Y' \tyotta \t1E+24\n"
- "\t'Z' \tzetta \t1E+21\n"
- "\t'E' \texa \t1E+18\n"
- "\t'P' \tpeta \t1E+15\n"
- "\t'T' \ttera \t\t1E+12\n"
- "\t'G' \tgiga \t1E+09\n"
- "\t'M' \tmega \t1E+06\n"
- "\t'k' \tkilo \t\t1E+03\n"
- "\t'h' \thecto \t1E+02\n"
- "\t'e' \tdeka \t1E+01\n"
- "\t'd' \tdeci \t1E-01\n"
- "\t'c' \tcenti \t\t1E-02\n"
- "\t'm' \tmilli \t\t1E-03\n"
- "\t'u' \tmicro \t1E-06\n"
- "\t'n' \tnano \t1E-09\n"
- "\t'p' \tpico \t1E-12\n"
- "\t'f' \tfemto \t1E-15\n"
- "\t'a' \tatto \t\t1E-18\n"
- "\t'z' \tzepto \t\t1E-21\n"
- "\t'y' \tyocto \t\t1E-24\n"
- "\n"
- "* If @from_unit and @to_unit are different types, CONVERT returns "
- "#N/A error.\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "CONVERT(3,\"lbm\",\"g\") equals 1360.7769.\n"
- "CONVERT(5.8,\"m\",\"in\") equals 228.3465.\n"
- "CONVERT(7.9,\"cal\",\"J\") equals 33.07567.\n"
- "\n"
- "@SEEALSO=")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("CONVERT:a converted measurement") },
+ { GNM_FUNC_HELP_ARG, F_("x:number") },
+ { GNM_FUNC_HELP_ARG, F_("from:unit (string)") },
+ { GNM_FUNC_HELP_ARG, F_("to:unit (string)") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("CONVERT returns a conversion from one measurement system to another. "
+ "@{x} is a value in @{from} units that is to be converted into @{to} units.") },
+ { GNM_FUNC_HELP_NOTE, F_("If @{from} and @{to} are different types, CONVERT returns #N/A!") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("@{from} and @{to} can be any of the following:\n\n"
+ "Weight and mass:\n"
+ "\t'g' \t\t\tGram\n"
+ "\t'sg' \t\t\tSlug\n"
+ "\t'lbm'\t\tPound\n"
+ "\t'u' \t\t\tU (atomic mass)\n"
+ "\t'ozm'\t\tOunce\n\n"
+ "Distance:\n"
+ "\t'm' \t\tMeter\n"
+ "\t'mi' \t\tStatute mile\n"
+ "\t'Nmi' \t\tNautical mile\n"
+ "\t'in' \t\t\tInch\n"
+ "\t'ft' \t\t\tFoot\n"
+ "\t'yd' \t\tYard\n"
+ "\t'ang' \t\tAngstrom\n"
+ "\t'Pica'\t\tPica\n\n"
+ "Time:\n"
+ "\t'yr' \t\t\tYear\n"
+ "\t'day' \t\tDay\n"
+ "\t'hr' \t\t\tHour\n"
+ "\t'mn' \t\tMinute\n"
+ "\t'sec' \t\tSecond\n\n"
+ "Pressure:\n"
+ "\t'Pa' \t\tPascal\n"
+ "\t'atm' \t\tAtmosphere\n"
+ "\t'mmHg'\t\tmm of Mercury\n\n"
+ "Force:\n"
+ "\t'N' \t\t\tNewton\n"
+ "\t'dyn' \t\tDyne\n"
+ "\t'lbf' \t\t\tPound force\n\n"
+ "Energy:\n"
+ "\t'J' \t\t\tJoule\n"
+ "\t'e' \t\tErg\n"
+ "\t'c' \t\tThermodynamic calorie\n"
+ "\t'cal' \t\tIT calorie\n"
+ "\t'eV' \t\tElectron volt\n"
+ "\t'HPh' \t\tHorsepower-hour\n"
+ "\t'Wh' \t\tWatt-hour\n"
+ "\t'flb' \t\tFoot-pound\n"
+ "\t'BTU' \t\tBTU\n\n"
+ "Power:\n"
+ "\t'HP' \t\tHorsepower\n"
+ "\t'W' \t\tWatt\n\n"
+ "Magnetism:\n"
+ "\t'T' \t\tTesla\n"
+ "\t'ga' \t\tGauss\n\n"
+ "Temperature:\n"
+ "\t'C' \t\tDegree Celsius\n"
+ "\t'F' \t\tDegree Fahrenheit\n"
+ "\t'K' \t\tDegree Kelvin\n\n"
+ "Liquid measure:\n"
+ "\t'tsp' \t\tTeaspoon\n"
+ "\t'tbs' \t\tTablespoon\n"
+ "\t'oz' \t\tFluid ounce\n"
+ "\t'cup' \t\tCup\n"
+ "\t'pt' \t\tPint\n"
+ "\t'qt' \t\tQuart\n"
+ "\t'gal' \t\tGallon\n"
+ "\t'l' \t\t\tLiter\n\n"
+ "For metric units any of the following prefixes can be used:\n"
+ "\t'Y' \tyotta \t\t1E+24\n"
+ "\t'Z' \tzetta \t\t1E+21\n"
+ "\t'E' \texa \t\t1E+18\n"
+ "\t'P' \tpeta \t\t1E+15\n"
+ "\t'T' \ttera \t\t1E+12\n"
+ "\t'G' \tgiga \t\t1E+09\n"
+ "\t'M' \tmega \t\t1E+06\n"
+ "\t'k' \tkilo \t\t1E+03\n"
+ "\t'h' \thecto \t\t1E+02\n"
+ "\t'e' \tdeca (deka)\t1E+01\n"
+ "\t'd' \tdeci \t\t1E-01\n"
+ "\t'c' \tcenti \t\t1E-02\n"
+ "\t'm' \tmilli \t\t1E-03\n"
+ "\t'u' \tmicro \t\t1E-06\n"
+ "\t'n' \tnano \t\t1E-09\n"
+ "\t'p' \tpico \t\t1E-12\n"
+ "\t'f' \tfemto \t\t1E-15\n"
+ "\t'a' \tatto \t\t1E-18\n"
+ "\t'z' \tzepto \t\t1E-21\n"
+ "\t'y' \tyocto \t\t1E-24") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=CONVERT(3,\"lbm\",\"g\")" },
+ { GNM_FUNC_HELP_EXAMPLES, "=CONVERT(5.8,\"m\",\"in\")" },
+ { GNM_FUNC_HELP_EXAMPLES, "=CONVERT(7.9,\"cal\",\"J\")" },
+ { GNM_FUNC_HELP_END}
};
typedef struct {
@@ -992,83 +817,83 @@ static GnmValue *
gnumeric_convert (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
/* Weight and mass constants */
- #define one_g_to_sg 0.00006852205001
- #define one_g_to_lbm 0.002204622915
- #define one_g_to_u 6.02217e+23
- #define one_g_to_ozm 0.035273972
+#define one_g_to_sg 0.00006852205001
+#define one_g_to_lbm 0.002204622915
+#define one_g_to_u 6.02217e+23
+#define one_g_to_ozm 0.035273972
/* Distance constants */
- #define one_m_to_mi (one_m_to_yd / 1760)
- #define one_m_to_Nmi (1 / GNM_const (1852.0))
- #define one_m_to_in (10000 / GNM_const (254.0))
- #define one_m_to_ft (one_m_to_in / 12)
- #define one_m_to_yd (one_m_to_ft / 3)
- #define one_m_to_ang GNM_const (1e10)
- #define one_m_to_Pica 2834.645669
+#define one_m_to_mi (one_m_to_yd / 1760)
+#define one_m_to_Nmi (1 / GNM_const (1852.0))
+#define one_m_to_in (10000 / GNM_const (254.0))
+#define one_m_to_ft (one_m_to_in / 12)
+#define one_m_to_yd (one_m_to_ft / 3)
+#define one_m_to_ang GNM_const (1e10)
+#define one_m_to_Pica 2834.645669
/* Time constants */
- #define one_yr_to_day 365.25
- #define one_yr_to_hr (24 * one_yr_to_day)
- #define one_yr_to_mn (60 * one_yr_to_hr)
- #define one_yr_to_sec (60 * one_yr_to_mn)
+#define one_yr_to_day 365.25
+#define one_yr_to_hr (24 * one_yr_to_day)
+#define one_yr_to_mn (60 * one_yr_to_hr)
+#define one_yr_to_sec (60 * one_yr_to_mn)
/* Pressure constants */
- #define one_Pa_to_atm 0.9869233e-5
- #define one_Pa_to_mmHg 0.00750061708
+#define one_Pa_to_atm 0.9869233e-5
+#define one_Pa_to_mmHg 0.00750061708
/* Force constants */
- #define one_N_to_dyn 100000
- #define one_N_to_lbf 0.224808924
+#define one_N_to_dyn 100000
+#define one_N_to_lbf 0.224808924
/* Power constants */
- #define one_HP_to_W 745.701
+#define one_HP_to_W 745.701
/* Energy constants */
- #define one_J_to_e 9999995.193
- #define one_J_to_c 0.239006249
- #define one_J_to_cal 0.238846191
- #define one_J_to_eV 6.2146e+18
- #define one_J_to_HPh (GNM_const (1.0) / (3600 * one_HP_to_W))
- #define one_J_to_Wh (GNM_const (1.0) / 3600)
- #define one_J_to_flb 23.73042222
- #define one_J_to_BTU 0.000947815
+#define one_J_to_e 9999995.193
+#define one_J_to_c 0.239006249
+#define one_J_to_cal 0.238846191
+#define one_J_to_eV 6.2146e+18
+#define one_J_to_HPh (GNM_const (1.0) / (3600 * one_HP_to_W))
+#define one_J_to_Wh (GNM_const (1.0) / 3600)
+#define one_J_to_flb 23.73042222
+#define one_J_to_BTU 0.000947815
/* Magnetism constants */
- #define one_T_to_ga 10000
+#define one_T_to_ga 10000
/* Temperature constants */
const gnm_float C_K_offset = GNM_const (273.15);
/* Liquid measure constants */
- #define one_tsp_to_tbs (GNM_const (1.0) / 3)
- #define one_tsp_to_oz (GNM_const (1.0) / 6)
- #define one_tsp_to_cup (GNM_const (1.0) / 48)
- #define one_tsp_to_pt (GNM_const (1.0) / 96)
- #define one_tsp_to_qt (GNM_const (1.0) / 192)
- #define one_tsp_to_gal (GNM_const (1.0) / 768)
- #define one_tsp_to_l 0.004929994
+#define one_tsp_to_tbs (GNM_const (1.0) / 3)
+#define one_tsp_to_oz (GNM_const (1.0) / 6)
+#define one_tsp_to_cup (GNM_const (1.0) / 48)
+#define one_tsp_to_pt (GNM_const (1.0) / 96)
+#define one_tsp_to_qt (GNM_const (1.0) / 192)
+#define one_tsp_to_gal (GNM_const (1.0) / 768)
+#define one_tsp_to_l 0.004929994
/* Prefixes */
- #define yotta GNM_const (1e+24)
- #define zetta GNM_const (1e+21)
- #define exa GNM_const (1e+18)
- #define peta GNM_const (1e+15)
- #define tera GNM_const (1e+12)
- #define giga GNM_const (1e+09)
- #define mega GNM_const (1e+06)
- #define kilo GNM_const (1e+03)
- #define hecto GNM_const (1e+02)
- #define deka GNM_const (1e+01)
- #define deci GNM_const (1e-01)
- #define centi GNM_const (1e-02)
- #define milli GNM_const (1e-03)
- #define micro GNM_const (1e-06)
- #define nano GNM_const (1e-09)
- #define pico GNM_const (1e-12)
- #define femto GNM_const (1e-15)
- #define atto GNM_const (1e-18)
- #define zepto GNM_const (1e-21)
- #define yocto GNM_const (1e-24)
+#define yotta GNM_const (1e+24)
+#define zetta GNM_const (1e+21)
+#define exa GNM_const (1e+18)
+#define peta GNM_const (1e+15)
+#define tera GNM_const (1e+12)
+#define giga GNM_const (1e+09)
+#define mega GNM_const (1e+06)
+#define kilo GNM_const (1e+03)
+#define hecto GNM_const (1e+02)
+#define deka GNM_const (1e+01)
+#define deci GNM_const (1e-01)
+#define centi GNM_const (1e-02)
+#define milli GNM_const (1e-03)
+#define micro GNM_const (1e-06)
+#define nano GNM_const (1e-09)
+#define pico GNM_const (1e-12)
+#define femto GNM_const (1e-15)
+#define atto GNM_const (1e-18)
+#define zepto GNM_const (1e-21)
+#define yocto GNM_const (1e-24)
static const eng_convert_unit_t weight_units[] = {
{ "g", 1.0 },
@@ -1199,34 +1024,34 @@ gnumeric_convert (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
return value_new_float (n - C_K_offset);
if (convert (weight_units, prefixes, from_unit, to_unit, n, &v,
- ei->pos))
+ ei->pos))
return v;
if (convert (distance_units, prefixes, from_unit, to_unit, n, &v,
- ei->pos))
+ ei->pos))
return v;
if (convert (time_units, NULL, from_unit, to_unit, n, &v,
- ei->pos))
+ ei->pos))
return v;
if (convert (pressure_units, prefixes, from_unit, to_unit, n, &v,
- ei->pos))
+ ei->pos))
return v;
if (convert (force_units, prefixes, from_unit, to_unit, n, &v,
- ei->pos))
+ ei->pos))
return v;
if (convert (energy_units, prefixes, from_unit, to_unit, n, &v,
- ei->pos))
+ ei->pos))
return v;
if (convert (power_units, prefixes, from_unit, to_unit, n, &v,
- ei->pos))
+ ei->pos))
return v;
if (convert (magnetism_units, prefixes, from_unit, to_unit, n, &v,
- ei->pos))
+ ei->pos))
return v;
if (convert (liquid_units, prefixes, from_unit, to_unit, n, &v,
- ei->pos))
+ ei->pos))
return v;
if (convert (magnetism_units, prefixes, from_unit, to_unit, n, &v,
- ei->pos))
+ ei->pos))
return v;
return value_new_error_NA (ei->pos);
@@ -1235,37 +1060,18 @@ gnumeric_convert (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_erf[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=ERF\n"
- "@SYNTAX=ERF([lower limit,]upper_limit)\n"
-
- "@DESCRIPTION="
- "ERF returns the error function. With a single argument ERF "
- "returns the error function, defined as\n\n\t"
- "erf(x) = 2/sqrt(pi)* integral from 0 to x of exp(-t*t) dt.\n\n"
- "If two arguments are supplied, they are the lower and upper "
- "limits of the integral.\n"
- "\n"
- "* If either @lower_limit or @upper_limit is not numeric a "
- "#VALUE! error is returned.\n"
- "* This function is upward-compatible with that in Excel. "
- "(If two arguments are supplied, "
- "Excel will not allow either to be negative.)\n"
- "\n"
- "@EXAMPLES=\n"
- "ERF(0.4) equals 0.428392355.\n"
- "ERF(1.6448536269515/SQRT(2)) equals 0.90.\n"
- "\n"
- "The second example shows that a random variable with a normal "
- "distribution has a 90 percent chance of falling within "
- "approximately 1.645 standard deviations of the mean."
- "\n"
- "@SEEALSO=ERFC")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("ERF:Gauss error function") },
+ { GNM_FUNC_HELP_ARG, F_("lower:lower limit of the integral, defaults to 0") },
+ { GNM_FUNC_HELP_ARG, F_("upper:upper limit of the integral") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("ERF returns 2/sqrt(\xcf\x80)* integral from @{lower} to @{upper} of exp(-t*t) dt") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible if two arguments are supplied and neither is negative.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=ERF(0.4)" },
+ { GNM_FUNC_HELP_EXAMPLES, "=ERF(1.6448536269515/SQRT(2))" },
+ { GNM_FUNC_HELP_SEEALSO, "ERFC" },
+ { GNM_FUNC_HELP_EXTREF, F_("wiki:en:Error_function") },
+ { GNM_FUNC_HELP_END}
};
-
static GnmValue *
gnumeric_erf (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
@@ -1286,24 +1092,13 @@ gnumeric_erf (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_erfc[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=ERFC\n"
- "@SYNTAX=ERFC(x)\n"
-
- "@DESCRIPTION="
- "ERFC function returns the complementary "
- "error function, defined as\n\n\t1 - erf(x).\n\n"
- "erfc(x) is calculated more accurately than 1 - erf(x) for "
- "arguments larger than about 0.5.\n"
- "\n"
- "* If @x is not numeric a #VALUE! error is returned. "
- "\n"
- "@EXAMPLES=\n"
- "ERFC(6) equals 2.15197367e-17.\n"
- "\n"
- "@SEEALSO=ERF")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("ERF:Complementary Gauss error function") },
+ { GNM_FUNC_HELP_ARG, F_("x:number") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("ERFC returns 2/sqrt(\xcf\x80)* integral from @{x} to \xe2\x88\x9e of exp(-t*t) dt") },
+ { GNM_FUNC_HELP_EXAMPLES, "=ERFC(6)" },
+ { GNM_FUNC_HELP_SEEALSO, "ERF" },
+ { GNM_FUNC_HELP_EXTREF, F_("wiki:en:Error_function") },
+ { GNM_FUNC_HELP_END}
};
static GnmValue *
@@ -1317,26 +1112,17 @@ gnumeric_erfc (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_delta[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=DELTA\n"
- "@SYNTAX=DELTA(x[,y])\n"
-
- "@DESCRIPTION="
- "DELTA function tests for numerical equivalence of two "
- "arguments, returning 1 in case of equality.\n\n"
- "* @y is optional, and defaults to 0.\n"
- "* If either argument is non-numeric returns a #VALUE! error.\n"
- "* This function is Excel compatible.\n"
- "\n"
- "@EXAMPLES=\n"
- "DELTA(42.99,43) equals 0.\n"
- "\n"
- "@SEEALSO=EXACT,GESTEP")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("DELTA:Kronecker delta function") },
+ { GNM_FUNC_HELP_ARG, F_("x0:number") },
+ { GNM_FUNC_HELP_ARG, F_("x1:number, defaults to 0") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("DELTA returns 1 if @{x1} = @{x0} and 0 otherwise.") },
+ { GNM_FUNC_HELP_NOTE, F_("If either argument is non-numeric, #VALUE! is returned.") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=DELTA(42.99,43)" },
+ { GNM_FUNC_HELP_SEEALSO, "EXACT,GESTEP" },
+ { GNM_FUNC_HELP_END}
};
-
static GnmValue *
gnumeric_delta (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
@@ -1349,25 +1135,17 @@ gnumeric_delta (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_gestep[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=GESTEP\n"
- "@SYNTAX=GESTEP(x[,y])\n"
- "@DESCRIPTION="
- "GESTEP function tests if @x is >= @y, returning 1 if it "
- "is so, and 0 otherwise. @y is optional, and defaults to 0.\n"
- "\n"
- "* If either argument is non-numeric returns a #VALUE! error.\n"
- "* This function is Excel compatible."
- "\n"
- "@EXAMPLES=\n"
- "GESTEP(5,4) equals 1.\n"
- "\n"
- "@SEEALSO=DELTA")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("GESTEP:Step function with step at @{x1} evaluated at @{x0}") },
+ { GNM_FUNC_HELP_ARG, F_("x0:number") },
+ { GNM_FUNC_HELP_ARG, F_("x1:number, defaults to 0") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("GESTEP returns 1 if @{x1} \xe2\x89\xa4 @{x0} and 0 otherwise.") },
+ { GNM_FUNC_HELP_NOTE, F_("If either argument is non-numeric, #VALUE! is returned.") },
+ { GNM_FUNC_HELP_EXCEL, F_("This function is Excel compatible.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=GESTEP(5,4)" },
+ { GNM_FUNC_HELP_SEEALSO, "DELTA" },
+ { GNM_FUNC_HELP_END}
};
-
static GnmValue *
gnumeric_gestep (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
@@ -1380,26 +1158,19 @@ gnumeric_gestep (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
static GnmFuncHelp const help_invsuminv[] = {
- { GNM_FUNC_HELP_OLD,
- F_("@FUNCTION=INVSUMINV\n"
- "@SYNTAX=INVSUMINV(x1,x2,...)\n"
- "@DESCRIPTION="
- "INVSUMINV sum calculates the inverse of the sum of inverses.\n"
- "\n"
- "The primary use of this is for calculating equivalent resistance for "
- "parallel resistors or equivalent capacitance of a series of capacitors.\n"
- "\n"
- "* All arguments must be non-negative, or else a #VALUE! result is returned.\n"
- "* If any argument is zero, the result is zero.\n"
- "\n"
- "@EXAMPLES=\n"
- "INVSUMINV(2000,2000) equals 1000.\n"
- "\n"
- "@SEEALSO=HARMEAN")
- },
- { GNM_FUNC_HELP_END }
+ { GNM_FUNC_HELP_NAME, F_("INVSUMINV:the reciprocal of the sum of reciprocals of the arguments") },
+ { GNM_FUNC_HELP_ARG, F_("x0:non-negative number") },
+ { GNM_FUNC_HELP_ARG, F_("x1:non-negative number") },
+ { GNM_FUNC_HELP_NOTE, F_("If any of the arguments is negative, #VALUE! is returned.\n"
+ "If any argument is zero, the result is zero.") },
+ { GNM_FUNC_HELP_DESCRIPTION, F_("INVSUMINV sum calculates the reciprocal (the inverse) "
+ "of the sum of reciprovals (inverses) of all its arguments.") },
+ { GNM_FUNC_HELP_EXAMPLES, "=INVSUMINV(2000,2000)" },
+ { GNM_FUNC_HELP_SEEALSO, "HARMEAN" },
+ { GNM_FUNC_HELP_END}
};
+
static int
range_invsuminv (gnm_float const *xs, int n, gnm_float *res)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]