aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugin_math.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/plugin_math.c b/plugin_math.c
index d1216a9..e5a3cc0 100644
--- a/plugin_math.c
+++ b/plugin_math.c
@@ -1,4 +1,4 @@
-/* $Id: plugin_math.c,v 1.7 2005/01/18 06:30:23 reinelt Exp $
+/* $Id: plugin_math.c,v 1.8 2005/04/05 04:46:06 reinelt Exp $
*
* math plugin
*
@@ -23,6 +23,9 @@
*
*
* $Log: plugin_math.c,v $
+ * Revision 1.8 2005/04/05 04:46:06 reinelt
+ * ceil/floor patch from Maxime
+ *
* Revision 1.7 2005/01/18 06:30:23 reinelt
* added (C) to all copyright statements
*
@@ -135,6 +138,18 @@ static void my_max (RESULT *result, RESULT *arg1, RESULT *arg2)
SetResult(&result, R_NUMBER, &value);
}
+static void my_floor (RESULT *result, RESULT *arg)
+{
+ double value = floor(R2N(arg));
+ SetResult(&result, R_NUMBER, &value);
+}
+
+static void my_ceil (RESULT *result, RESULT *arg)
+{
+ double value = ceil(R2N(arg));
+ SetResult(&result, R_NUMBER, &value);
+}
+
int plugin_init_math (void)
{
@@ -155,6 +170,10 @@ int plugin_init_math (void)
AddFunction ("min", 2, my_min);
AddFunction ("max", 2, my_max);
+ /* floor, ceil */
+ AddFunction ("floor", 1, my_floor);
+ AddFunction ("ceil", 1, my_ceil);
+
return 0;
}
t'>update scan files for de-*Christoph Pfister10-32/+32 2010-05-24update scan file for fr-ChamberyChristoph Pfister1-24/+18 submitted by n_estre yahoo.fr 2010-05-23update scan file for fr-NantesChristoph Pfister1-6/+7 submitted by biribi free.fr 2010-05-23update scan file for fr-Lille-BouvignyChristoph Pfister3-43/+26 and remove obsoleted files submitted by romain romain-bajeux.com 2010-05-19update scan file for fr-LavalChristoph Pfister1-6/+6 submitted by hftom free.fr 2010-05-19update scan file for fr-NantesChristoph Pfister1-6/+6 submitted by matpic free.fr 2010-05-16update scan file for de-HamburgChristoph Pfister1-0/+1 submitted by toralf.foerster gmx.de 2010-05-09update scan file for de-UnitymediaChristoph Pfister1-8/+9 2010-05-02update scan file for hr-AllChristoph Pfister1-1/+1 submitted by samuel.rakitnican gmail.com 2010-04-29update scan file for de-PrimacomChristoph Pfister1-0/+5 submitted by robert.wohlrab gmx.de 2010-04-29update scan file for dk-AllChristoph Pfister1-5/+11 submitted by rk.katana.steel gmail.com 2010-04-29update scan file for fi-TurkuChristoph Pfister1-1/+7 submitted by miika vesti.fi 2010-04-29update scan file for uk-AberdareChristoph Pfister1-10/+15 submitted by redtux1 googlemail.com 2010-04-29update scan file for fr-NantesChristoph Pfister1-6/+6 submitted by debotux gmail.com