Mercurial > hg > octave-lyh
diff src/mappers.cc @ 1173:99fbb85d8152
[project @ 1995-03-21 14:49:52 by jwe]
author | jwe |
---|---|
date | Tue, 21 Mar 1995 14:49:52 +0000 |
parents | 42731861ee09 |
children | b6360f2d4fa6 |
line wrap: on
line diff
--- a/src/mappers.cc +++ b/src/mappers.cc @@ -1,7 +1,7 @@ // mappers.cc -*- C++ -*- /* -Copyright (C) 1992, 1993 John W. Eaton +Copyright (C) 1992, 1993, 1995 John W. Eaton This file is part of Octave. @@ -30,6 +30,7 @@ #include <Complex.h> #include "missing-math.h" +#include "f77-uscore.h" #include "variables.h" #include "mappers.h" #include "error.h" @@ -41,6 +42,12 @@ #define finite(x) ((x) < DBL_MAX && (x) > -DBL_MAX) #endif +extern "C" +{ + double F77_FCN (dgamma) (double*); + int F77_FCN (dlgams) (double*, double*, double*); +} + #ifndef M_LOG10E #define M_LOG10E 0.43429448190325182765 #endif @@ -152,12 +159,7 @@ double xgamma (double x) { -#if defined (HAVE_LGAMMA) - double y = lgamma (x); - return signgam * exp (y); -#else - error ("gamma(x) not available on this system"); -#endif + return F77_FCN (dgamma) (&x); } double @@ -175,11 +177,12 @@ double xlgamma (double x) { -#if defined (HAVE_LGAMMA) - return lgamma (x); -#else - error ("lgamma (x) not available on this system"); -#endif + double result; + double sgngam; + + F77_FCN (dlgams) (&x, &result, &sgngam); + + return result; } // Complex -> double mappers.