f2clib.c File Reference

#include "f2c.h"
#include "math.h"

Include dependency graph for f2clib.c:

Go to the source code of this file.

Functions

integer i_nint (real *x)
integer pow_ii (integer *ap, integer *bp)
double r_sign (real *a, real *b)


Function Documentation

integer i_nint ( real x  ) 

Definition at line 80 of file f2clib.c.

Referenced by placea_(), voicin_(), and vparms_().

00082 {
00083 return( (integer)((*x)>=0 ?
00084    floor(*x + .5) : -floor(.5 - *x)) );
00085 }

integer pow_ii ( integer ap,
integer bp 
)

Definition at line 30 of file f2clib.c.

Referenced by decode_(), and encode_().

00032 {
00033    integer pow, x, n;
00034    unsigned long u;
00035 
00036    x = *ap;
00037    n = *bp;
00038 
00039    if (n <= 0) {
00040       if (n == 0 || x == 1)
00041          return 1;
00042       if (x != -1)
00043          return x == 0 ? 0 : 1/x;
00044       n = -n;
00045       }
00046    u = n;
00047    for(pow = 1; ; )
00048       {
00049       if(u & 01)
00050          pow *= x;
00051       if(u >>= 1)
00052          x *= x;
00053       else
00054          break;
00055       }
00056    return(pow);
00057    }

double r_sign ( real a,
real b 
)

Definition at line 64 of file f2clib.c.

Referenced by onset_(), and vparms_().

00066 {
00067 double x;
00068 x = (*a >= 0 ? *a : - *a);
00069 return( *b >= 0 ? x : -x);
00070 }


Generated on Thu Apr 16 06:30:57 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6