cells.bend checks
raw source on the hub · import bend-ndarray@0.1.3.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 316 · 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 390 · raw
Data
UNegU1
UAbsU1
UNotU1
UScale@by:U32 -> U1
UConv@to:0xcc7fe2a980487676abb11c4601fc801f/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:0xcc7fe2a980487676abb11c4601fc801f/shape.DType -> Bool
def is_bool source · line 110 · raw
@dt:0xcc7fe2a980487676abb11c4601fc801f/shape.DType -> Bool
def supports source · line 119 · raw
@op:B2 -> @+dt:0xcc7fe2a980487676abb11c4601fc801f/shape.DType -> Bool
which dtypes an operation takes: arithmetic on numbers (true division and power on float32 only), comparisons on every dtype, logic on bool
def is_cmp source · line 150 · raw
@op:B2 -> Bool
def is_i32 source · line 167 · raw
@dt:0xcc7fe2a980487676abb11c4601fc801f/shape.DType -> Bool
def is_u8 source · line 174 · raw
@dt:0xcc7fe2a980487676abb11c4601fc801f/shape.DType -> Bool
def beq source · line 181 · raw
@a:Bool -> @b:Bool -> Bool
def f_rem_fix source · line 193 · raw
@+r:F32 -> @+y:F32 -> F32
fmod's remainder (the dividend's sign) to Python's (the divisor's)
def f2 source · line 196 · raw
@op:B2 -> @+x:U32 -> @+y:U32 -> U32
def i_div_go source · line 238 · 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 245 · raw
@+x:U32 -> U32
def i_fdiv source · line 248 · raw
@+x:U32 -> @+y:U32 -> U32
def i_rem source · line 252 · raw
@+x:U32 -> @+y:U32 -> U32
def u_fdiv source · line 255 · raw
@+x:U32 -> @+y:U32 -> U32
def u_rem source · line 258 · raw
@+x:U32 -> @+y:U32 -> U32
def i2 source · line 262 · 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 300 · raw
@+op:B2 -> @dt:0xcc7fe2a980487676abb11c4601fc801f/shape.DType -> @+x:U32 -> @+y:U32 -> U32
one cell of a binary operation
def rint_zero source · line 338 · 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 341 · raw
@+x:F32 -> @+f:F32 -> F32
def rint source · line 346 · raw
@+x:F32 -> F32
def math source · line 349 · raw
@f:MF -> @+x:F32 -> F32
def i32_to_f32 source · line 400 · raw
@+x:U32 -> F32
def f32_to_i32 source · line 404 · raw
@+f:F32 -> U32
float32 to int32 bits, toward zero
def conv_from_f32 source · line 407 · raw
@to:0xcc7fe2a980487676abb11c4601fc801f/shape.DType -> @+x:U32 -> U32
def conv_int source · line 420 · raw
@+signed:Bool -> @to:0xcc7fe2a980487676abb11c4601fc801f/shape.DType -> @+x:U32 -> U32
def conv source · line 431 · raw
@from:0xcc7fe2a980487676abb11c4601fc801f/shape.DType -> @+to:0xcc7fe2a980487676abb11c4601fc801f/shape.DType -> @+x:U32 -> U32
def f_sign source · line 440 · raw
@+x:U32 -> U32
def sign source · line 444 · raw
@dt:0xcc7fe2a980487676abb11c4601fc801f/shape.DType -> @+x:U32 -> U32
-1, 0 or 1 (unsigned: 0 or 1; float32: nan stays nan, a zero keeps its sign)
def cell1 source · line 453 · raw
@op:U1 -> @+dt:0xcc7fe2a980487676abb11c4601fc801f/shape.DType -> @+x:U32 -> U32