Table of Contents

Class NDIntegerPower

Namespace
NumSharp.Utilities
Assembly
NumSharp.dll

Integer power helpers matching NumPy's @TYPE@_power loop in loops.c.src. Uses repeated-squaring with native dtype wraparound (e.g. uint8 ** 8 = 0).

These helpers assume the exponent is non-negative. NumPy raises ValueError("Integers to negative integer powers are not allowed.") for any negative integer exponent, regardless of base value; the caller is responsible for that pre-check (see DefaultEngine.Power).

public static class NDIntegerPower
Inheritance
NDIntegerPower
Inherited Members

Methods

PowByte(byte, byte)

public static byte PowByte(byte a, byte b)

Parameters

a byte
b byte

Returns

byte

PowChar(char, char)

public static char PowChar(char a, char b)

Parameters

a char
b char

Returns

char

PowInt16(short, short)

public static short PowInt16(short a, short b)

Parameters

a short
b short

Returns

short

PowInt32(int, int)

public static int PowInt32(int a, int b)

Parameters

a int
b int

Returns

int

PowInt64(long, long)

public static long PowInt64(long a, long b)

Parameters

a long
b long

Returns

long

PowSByte(sbyte, sbyte)

public static sbyte PowSByte(sbyte a, sbyte b)

Parameters

a sbyte
b sbyte

Returns

sbyte

PowUInt16(ushort, ushort)

public static ushort PowUInt16(ushort a, ushort b)

Parameters

a ushort
b ushort

Returns

ushort

PowUInt32(uint, uint)

public static uint PowUInt32(uint a, uint b)

Parameters

a uint
b uint

Returns

uint

PowUInt64(ulong, ulong)

public static ulong PowUInt64(ulong a, ulong b)

Parameters

a ulong
b ulong

Returns

ulong