Asterisk - The Open Source Telephony Project GIT-master-0bf3178
Functions
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

◆ i_nint()

integer i_nint ( real x)

Definition at line 80 of file f2clib.c.

82{
83return( (integer)((*x)>=0 ?
84 floor(*x + .5) : -floor(.5 - *x)) );
85}
INT32 integer
Definition: lpc10.h:80

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

◆ pow_ii()

integer pow_ii ( integer ap,
integer bp 
)

Definition at line 30 of file f2clib.c.

32{
33 integer pow, x, n;
34 unsigned long u;
35
36 x = *ap;
37 n = *bp;
38
39 if (n <= 0) {
40 if (n == 0 || x == 1)
41 return 1;
42 if (x != -1)
43 return x == 0 ? 0 : 1/x;
44 n = -n;
45 }
46 u = n;
47 for(pow = 1; ; )
48 {
49 if(u & 01)
50 pow *= x;
51 if(u >>= 1)
52 x *= x;
53 else
54 break;
55 }
56 return(pow);
57 }

Referenced by decode_(), and encode_().

◆ r_sign()

double r_sign ( real a,
real b 
)

Definition at line 64 of file f2clib.c.

66{
67double x;
68x = (*a >= 0 ? *a : - *a);
69return( *b >= 0 ? x : -x);
70}
static struct test_val b
static struct test_val a

References a, and b.

Referenced by onset_(), and vparms_().