cells.bend checks
raw source on the hub · import bend-ndarray@0.1.4.0/cells.bend as Cells
bend-ndarray's element functions: one cell (32 bits) at a time, by operation and dtype. float32 cells hold their IEEE bits; int32 two's complement; uint32 and uint8 their value (uint8 below 256); bool 0 or 1. Integer arithmetic wraps around (uint8 modulo 256), as NumPy's does.
2 imports
import Base import ./shape.bend as S
Types
type B2 source · line 38 · raw
Data
BAddB2
BSubB2
BMulB2
BDivB2
BFloorDivB2
BRemB2
BMinB2
BMaxB2
BPowB2
BEqB2
BNeB2
BLtB2
BLeB2
BGtB2
BGeB2
BAndB2
BOrB2
BXorB2
BAtan2B2
BHypotB2
type MF source · line 328 · raw
Data
float32 functions, one argument
MExpMF
MLogMF
MLog2MF
MLog10MF
MSqrtMF
MSinMF
MCosMF
MTanMF
MAsinMF
MAcosMF
MAtanMF
MSinhMF
MCoshMF
MTanhMF
MFloorMF
MCeilMF
MTruncMF
MRintMF
MRecipMF
type U1 source · line 402 · raw
Data
UNegU1
UAbsU1
UNotU1
UDivN@n:U32 -> U1
UConv@to:0xb394b5997edb05025e33977930018c47/shape.DType -> U1
UMath@f:MF -> U1
USquareU1
USignU1
Definitions
def fb source · line 7 · raw
@x:U32 -> F32
def bf source · line 12 · raw
@x:F32 -> U32
def b2u source · line 17 · raw
@b:Bool -> U32
def neg source · line 20 · raw
@+x:U32 -> U32
def is_neg source · line 23 · raw
@+x:U32 -> Bool
def u8 source · line 26 · raw
@+x:U32 -> U32
def slt source · line 30 · raw
@+x:U32 -> @+y:U32 -> Bool
signed order on int32 bits
def fnan source · line 33 · raw
@+x:U32 -> Bool
def op_name source · line 60 · raw
@op:B2 -> String
def is_f32 source · line 103 · raw
@dt:0xb394b5997edb05025e33977930018c47/shape.DType -> Bool
def is_float source · line 111 · raw
@dt:0xb394b5997edb05025e33977930018c47/shape.DType -> Bool
float32 or float64
def is_bool source · line 120 · raw
@dt:0xb394b5997edb05025e33977930018c47/shape.DType -> Bool
def supports source · line 129 · raw
@op:B2 -> @+dt:0xb394b5997edb05025e33977930018c47/shape.DType -> Bool
which dtypes an operation takes: arithmetic on numbers (true division, power, arctan2 and hypot on floats only), comparisons on every dtype, logic on bool
def is_cmp source · line 160 · raw
@op:B2 -> Bool
def is_i32 source · line 177 · raw
@dt:0xb394b5997edb05025e33977930018c47/shape.DType -> Bool
def is_u8 source · line 184 · raw
@dt:0xb394b5997edb05025e33977930018c47/shape.DType -> Bool
def beq source · line 191 · raw
@a:Bool -> @b:Bool -> Bool
def f_rem_fix source · line 203 · raw
@+r:F32 -> @+y:F32 -> F32
fmod's remainder (the dividend's sign) to Python's (the divisor's)
def f2 source · line 206 · raw
@op:B2 -> @+x:U32 -> @+y:U32 -> U32
def i_div_go source · line 248 · raw
@+q:U32 -> @+r:U32 -> @diff:Bool -> U32
int32 floor division and remainder (Python's // and %; 0 for a zero divisor, as NumPy)
def abs32 source · line 255 · raw
@+x:U32 -> U32
def i_fdiv source · line 258 · raw
@+x:U32 -> @+y:U32 -> U32
def i_rem source · line 262 · raw
@+x:U32 -> @+y:U32 -> U32
def u_fdiv source · line 265 · raw
@+x:U32 -> @+y:U32 -> U32
def u_rem source · line 268 · raw
@+x:U32 -> @+y:U32 -> U32
def i2 source · line 272 · raw
@op:B2 -> @+signed:Bool -> @+m:U32 -> @+x:U32 -> @+y:U32 -> U32
int32 (signed) and uint32 / uint8 / bool (unsigned); m is the mask for the result (255 for uint8)
def cell2 source · line 310 · raw
@+op:B2 -> @dt:0xb394b5997edb05025e33977930018c47/shape.DType -> @+x:U32 -> @+y:U32 -> U32
one cell of a binary operation
def rint_zero source · line 350 · raw
@+x:F32 -> @+r:F32 -> F32
to the nearest integer, halves to the even one (NumPy's rint and round); a zero keeps x's sign
def rint_pick source · line 353 · raw
@+x:F32 -> @+f:F32 -> F32
def rint source · line 358 · raw
@+x:F32 -> F32
def math source · line 361 · raw
@f:MF -> @+x:F32 -> F32
def i32_to_f32 source · line 412 · raw
@+x:U32 -> F32
def f32_to_i32 source · line 416 · raw
@+f:F32 -> U32
float32 to int32 bits, toward zero
def conv_from_f32 source · line 419 · raw
@to:0xb394b5997edb05025e33977930018c47/shape.DType -> @+x:U32 -> U32
def conv_int source · line 434 · raw
@+signed:Bool -> @to:0xb394b5997edb05025e33977930018c47/shape.DType -> @+x:U32 -> U32
def conv source · line 445 · raw
@from:0xb394b5997edb05025e33977930018c47/shape.DType -> @+to:0xb394b5997edb05025e33977930018c47/shape.DType -> @+x:U32 -> U32
def f_sign source · line 454 · raw
@+x:U32 -> U32
def sign source · line 458 · raw
@dt:0xb394b5997edb05025e33977930018c47/shape.DType -> @+x:U32 -> U32
-1, 0 or 1 (unsigned: 0 or 1; float32: nan stays nan, a zero of either sign gives +0, as NumPy)
def cell1 source · line 467 · raw
@op:U1 -> @+dt:0xb394b5997edb05025e33977930018c47/shape.DType -> @+x:U32 -> U32