Mercurial > hg > octave-lojdl
changeset 1173:99fbb85d8152
[project @ 1995-03-21 14:49:52 by jwe]
author | jwe |
---|---|
date | Tue, 21 Mar 1995 14:49:52 +0000 |
parents | f6cf5e07cbe5 |
children | e98dac05db24 |
files | src/mappers.cc |
diffstat | 1 files changed, 15 insertions(+), 12 deletions(-) [+] |
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.