Sha256: 85dc863945e842ef20acd029ce5a197fc5dfe3e8001cccb6fad0697ca59bec18

Contents?: true

Size: 989 Bytes

Versions: 9

Compression:

Stored size: 989 Bytes

Contents

typedef BIT_DIGIT dtype;
typedef BIT_DIGIT rtype;
#define cT  numo_cBit
#define cRT cT

#define m_zero 0
#define m_one  1

#define m_abs(x)     (x)
#define m_sign(x)    (((x)==0) ? 0:1)

#define m_from_double(x) (((x)==0) ? 0 : 1)
#define m_from_real(x) (((x)==0) ? 0 : 1)
#define m_from_sint(x) (((x)==0) ? 0 : 1)
#define m_from_int32(x) (((x)==0) ? 0 : 1)
#define m_from_int64(x) (((x)==0) ? 0 : 1)
#define m_from_uint32(x) (((x)==0) ? 0 : 1)
#define m_from_uint64(x) (((x)==0) ? 0 : 1)
#define m_data_to_num(x) INT2FIX(x)
#define m_sprintf(s,x)   sprintf(s,"%1d",(int)(x))

#define m_copy(x)  (x)
#define m_not(x)   (~(x))
#define m_and(x,y) ((x)&(y))
#define m_or(x,y)  ((x)|(y))
#define m_xor(x,y) ((x)^(y))
#define m_eq(x,y)  (~((x)^(y)))
#define m_count_true(x)  ((x)!=0)
#define m_count_false(x) ((x)==0)

static inline BIT_DIGIT m_num_to_data(VALUE num) {
    if (RTEST(num)) {
        if (!RTEST(rb_equal(num,INT2FIX(0)))) {
            return 1;
        }
    }
    return 0;
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
numo-narray-0.9.2.1 ext/numo/narray/numo/types/bit.h
numo-narray-0.9.2.0 ext/numo/narray/numo/types/bit.h
numo-narray-0.9.1.9 ext/numo/narray/numo/types/bit.h
numo-narray-0.9.1.8 ext/numo/narray/numo/types/bit.h
numo-narray-0.9.1.7 ext/numo/narray/numo/types/bit.h
numo-narray-0.9.1.6 ext/numo/narray/numo/types/bit.h
numo-narray-0.9.1.5 ext/numo/narray/numo/types/bit.h
numo-narray-0.9.1.4 ext/numo/narray/numo/types/bit.h
numo-narray-0.9.1.3 ext/numo/narray/numo/types/bit.h