MCPcopy Create free account
hub / github.com/numpy/numpy / r_sign

Function r_sign

numpy/linalg/lapack_lite/f2c.c:163–253  ·  view source on GitHub ↗
(a,b)

Source from the content-addressed store, hash-verified

161
162#ifdef KR_headers
163double r_sign(a,b) real *a, *b;
164#else
165double r_sign(real *a, real *b)
166#endif
167{
168float x;
169x = (*a >= 0.0f ? *a : - *a);
170return( *b >= 0.0f ? x : -x);
171}
172
173#ifdef KR_headers
174double d_sign(a,b) doublereal *a, *b;
175#else
176double d_sign(doublereal *a, doublereal *b)
177#endif
178{
179double x;
180x = (*a >= 0 ? *a : - *a);
181return( *b >= 0 ? x : -x);
182}
183
184
185#ifdef KR_headers
186double floor();
187integer i_dnnt(x) doublereal *x;
188#else
189#undef abs
190
191integer i_dnnt(doublereal *x)
192#endif
193{
194return( (*x)>=0 ?
195 floor(*x + .5) : -floor(.5 - *x) );
196}
197
198
199#ifdef KR_headers
200double floor();
201integer i_nint(x) real *x;
202#else
203#undef abs
204integer i_nint(real *x)
205#endif
206{
207return (integer)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x));
208}
209
210#ifdef KR_headers
211double pow();
212double pow_dd(ap, bp) doublereal *ap, *bp;
213#else
214#undef abs
215
216double pow_dd(doublereal *ap, doublereal *bp)
217#endif
218{
219return(pow(*ap, *bp) );
220}

Callers 15

clalsd_Function · 0.85
clarfg_Function · 0.85
csteqr_Function · 0.85
sbdsdc_Function · 0.85
sbdsqr_Function · 0.85
slaed3_Function · 0.85
slaed9_Function · 0.85
slalsd_Function · 0.85
slanv2_Function · 0.85
slarfg_Function · 0.85
slasd3_Function · 0.85
slasd8_Function · 0.85

Calls 1

floorFunction · 0.85

Tested by

no test coverage detected