/* $Id: e,v 1.1.1.1 2008/11/28 17:57:26 kiesling Exp $ -*-c-*-**/

/*
  This file is part of ctalk.
  Copyright  2005-2008 Robert Kiesling, ctalk@ctalklang.org.
  Permission is granted to copy this software provided that this copyright
  notice is included in all source code modules.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

/*
 *  Templates for erf(), erfc(), exp(), and expm1() C library functions.
 */

#define erf \n\
cErf (double d) {\n\
  char buf[MAXLABEL]; \n\
  sprintf (buf, "%f", erf (__ctalk_to_c_double (ARG(0)))); \n\
  return __ctalkCreateObjectInit ("result", "Float", \n\
     "Magnitude", LOCAL_VAR, buf); \n\
}

#define erfc \n\
cErfc (double d) {\n\
  char buf[MAXLABEL]; \n\
  sprintf (buf, "%f", erfc (__ctalk_to_c_double (ARG(0)))); \n\
  return __ctalkCreateObjectInit ("result", "Float", \n\
     "Magnitude", LOCAL_VAR, buf); \n\
}

#define exp \n\
cExp (double d) {\n\
  char buf[MAXLABEL]; \n\
  sprintf (buf, "%f", exp (__ctalk_to_c_double (ARG(0)))); \n\
  return __ctalkCreateObjectInit ("result", "Float", \n\
     "Magnitude", LOCAL_VAR, buf); \n\
}

#define expm1 \n\
cExpm1 (double d) {\n\
  char buf[MAXLABEL]; \n\
  sprintf (buf, "%f", expm1 (__ctalk_to_c_double (ARG(0)))); \n\
  return __ctalkCreateObjectInit ("result", "Float", \n\
     "Magnitude", LOCAL_VAR, buf); \n\
}
