CVS update: php3/functions

From: Date: Thu, 24 Sep 1998 01:06:52 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-1453@lists.php.net to get a copy of this message
Date: Wednesday September 23, 1998 @ 21:06 Author: rasmus Update of /repository/php3/functions In directory asf:/u2/tmp/cvs-serv13765/functions Modified Files: basic_functions.c math.c phpmath.h Log Message: Add atan2() function Index: php3/functions/basic_functions.c diff -c php3/functions/basic_functions.c:1.221 php3/functions/basic_functions.c:1.222 *** php3/functions/basic_functions.c:1.221 Tue Sep 22 15:39:33 1998 --- php3/functions/basic_functions.c Wed Sep 23 21:06:50 1998 *************** *** 232,237 **** --- 232,238 ---- {"asin", php3_asin, NULL}, {"acos", php3_acos, NULL}, {"atan", php3_atan, NULL}, + {"atan2", php3_atan2, NULL}, {"pi", php3_pi, NULL}, {"pow", php3_pow, NULL}, {"exp", php3_exp, NULL}, Index: php3/functions/math.c diff -c php3/functions/math.c:1.37 php3/functions/math.c:1.38 *** php3/functions/math.c:1.37 Tue Aug 25 08:26:53 1998 --- php3/functions/math.c Wed Sep 23 21:06:51 1998 *************** *** 216,221 **** --- 216,234 ---- return_value->type = IS_DOUBLE; } + void php3_atan2(INTERNAL_FUNCTION_PARAMETERS) + { + pval *num1, *num2; + + if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &num1, &num2) == FAILURE) { + WRONG_PARAM_COUNT; + } + convert_to_double(num1); + convert_to_double(num2); + return_value->value.dval = atan2(num1->value.dval,num2->value.dval); + return_value->type = IS_DOUBLE; + } + void php3_pi(INTERNAL_FUNCTION_PARAMETERS) { return_value->value.dval = M_PI; Index: php3/functions/phpmath.h diff -c php3/functions/phpmath.h:1.12 php3/functions/phpmath.h:1.13 *** php3/functions/phpmath.h:1.12 Tue Aug 25 08:26:53 1998 --- php3/functions/phpmath.h Wed Sep 23 21:06:51 1998 *************** *** 29,35 **** */ ! /* $Id: phpmath.h,v 1.12 1998/08/25 12:26:53 ssb Exp $ */ #ifndef _PHPMATH_H #define _PHPMATH_H --- 29,35 ---- */ ! /* $Id: phpmath.h,v 1.13 1998/09/24 01:06:51 rasmus Exp $ */ #ifndef _PHPMATH_H #define _PHPMATH_H *************** *** 39,44 **** --- 39,45 ---- extern void php3_asin(INTERNAL_FUNCTION_PARAMETERS); extern void php3_acos(INTERNAL_FUNCTION_PARAMETERS); extern void php3_atan(INTERNAL_FUNCTION_PARAMETERS); + extern void php3_atan2(INTERNAL_FUNCTION_PARAMETERS); extern void php3_pi(INTERNAL_FUNCTION_PARAMETERS); extern void php3_exp(INTERNAL_FUNCTION_PARAMETERS); extern void php3_log(INTERNAL_FUNCTION_PARAMETERS); -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#1453) next »