Sha256: 6da19914ee0fa9cd6b712ba0967b6b67924e7b49f893e6a9a11441ba66272d72

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

static void
<%=c_iter%>(na_loop_t *const lp)
{
    size_t   i;
    char    *p1, *p2, *p3;
    ssize_t  s1, s2, s3;
    dtype    x;
    int      y;
    INIT_COUNTER(lp, i);
    INIT_PTR(lp, 0, p1, s1);
    INIT_PTR(lp, 1, p2, s2);
    INIT_PTR(lp, 2, p3, s3);
    SHOW_SYNCHRONIZE_FIXME_WARNING_ONCE("<%=name%>", "<%=type_name%>");
    for (; i--;) {
        GET_DATA_STRIDE(p1,s1,dtype,x);
        x = m_<%=name%>(x,&y);
        SET_DATA_STRIDE(p2,s2,dtype,x);
        SET_DATA_STRIDE(p3,s3,int32_t,y);
    }
}

/*
  split the number x into a normalized fraction and an exponent.
  Returns [mantissa, exponent], where x = mantissa * 2**exponent.

  @overload <%=name%>(x)
  @param [Cumo::NArray,Numeric]  x
  @return [Cumo::<%=class_name%>,Cumo::Int32]  mantissa and exponent.

*/
static VALUE
<%=c_func(1)%>(VALUE mod, VALUE a1)
{
    ndfunc_arg_in_t ain[1] = {{cT,0}};
    ndfunc_arg_out_t aout[2] = {{cT,0},{cumo_cInt32,0}};
    ndfunc_t ndf = { <%=c_iter%>, STRIDE_LOOP, 1,2, ain,aout };
    return na_ndloop(&ndf, 1, a1);
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cumo-0.1.0 ext/cumo/narray/gen/tmpl/frexp.c