Class BigRational.SafeCPU
Represents a thread-safe instance of a shared BigRational.CPU for rational and arbitrary arithmetic.
Inheritance
Namespace: System.Numerics
Assembly: System.Numerics.Rational.dll
Syntax
public sealed class SafeCPU : ValueType
Remarks
Note: As a ref
type, it cannot be used in asynchronous methods, asynchronous lambda expressions.
query expressions, iterator blocks or inside non-static nested functions.
For such cases, however, it is safe to use a private instance of a BigRational.CPU object.
Methods
Name | Description |
---|---|
abs(Int32) | Convert the value at index |
add() | Adds the first two values on top of the stack and replaces them with the result. |
add(Int32, Int32) | Adds the values at index |
add(BigRational) | Adds value |
add(BigRational, BigRational) | Adds the values |
add(UInt32) | Adds the value at index a as absolute index in the stack
and the value on top of the stack. |
add(UInt32, UInt32) | Adds the values at index |
and() | Bitwise logical AND of the numerators |
atan(UInt32) | Replaces the value on top of the stack with the atan of that value. |
bdi() | Returns the MSB difference of numerator and denominator for the value at the top of the stack. |
cmp(Int32, Int32) | Compares the values at index |
cmp(BigRational) | Compares the value on top of the stack a with the BigRational value b. |
cmp(BigRational, BigRational) | Compares the BigRational value |
cmp(UInt32) | Compares the value on top of the stack with the value at b as absolute index in the stack. |
cmp(UInt32, UInt32) | Compares the values at index |
cmpa(Int32, Int32) | Compares the absolute values at index |
cmpi(Int32, Int32) | Compares the values at index |
dec() | Decrements the value on top of the stack. |
div() | Divides the first two values on top of the stack and replaces them with the result. |
div(Int32, Int32) | Divides the values at index |
div(BigRational, Int32) | Divides the value |
div(BigRational, BigRational) | Divides the values |
div(UInt32, UInt32) | Divides the values at index |
dup(Int32) | Duplicates the value at index |
dup(UInt32) | Duplicates the value at index |
equ(BigRational, BigRational) | Compares the BigRational value |
equ(UInt32, BigRational) | Compares the value at index a as absolute index in the stack with the BigRational value b for equality. |
equ(UInt32, UInt32) | Compares the values at index |
exp(UInt32) | Replaces the value on top of the stack with e raised to the power of that value. |
fac(UInt32) | Pushes the factorial of the specified number c on the stack. |
free() | Frees the current thread static instance of the BigRational.CPU and associated buffers. |
gcd() | Finds the greatest common divisor (GCD) of the numerators |
getd(UInt32) | Converts the value at absolute position |
getf(UInt32) | Converts the value at absolute position |
getr(UInt32) | Converts the value at absolute position |
gets(UInt32) | Exposes the internal data representation of the value at absolute position i on the stack. |
hash(UInt32) | Calculates a hash value for the value at b as absolute index in the stack. |
idiv() | Performs an integer division of the numerators of the first two values on top of the stack |
imod() | Performs an integer division of the numerators of the first two values on top of the stack |
inc() | Increments the value on top of the stack. |
inv(Int32) | Replaces the value at index |
ipt() | Evaluates whether the numerator of the value on top of the stack is a power of two. |
isi() | Returns whether the value on top of the stack is an integer. |
lim(UInt32, Int32) | Limitates the binary digits of the value at the top of the stack to the specified count |
log(UInt32) | Replaces the value on top of the stack with it's natural (base e) logarithm. Non-positive values result in NaN. |
log2(UInt32) | Replaces the value on top of the stack with it's base 2 logarithm. Non-positive values result in NaN. |
lsb() | Returns the LSB (least significant bit) of the numerator of the value on top of the stack. |
mark() | Returns a temporary absolute index of the current stack top from which subsequent instructions can index stack entries. |
mod(Int32) | Pops the value at the top of the stack. |
msb() | Returns the MSB (most significant bit) of the numerator of the value on top of the stack. |
mul() | Multiplies the first two values on top of the stack and replaces them with the result. |
mul(Int32, Int32) | Multiplies the values at index |
mul(BigRational) | Multiplies value |
mul(BigRational, BigRational) | Multiplies the values |
mul(BigRational, UInt32) | Multiplies the value |
mul(UInt32) | Multiplies the value at index a as absolute index in the stack
and the value on top of the stack. |
mul(UInt32, UInt32) | Multiplies the values at index |
neg(Int32) | Negates the value at index |
neg(UInt32) | Negates the value at index |
norm(Int32) | Normalize the value at the specified index relative to the top of the stack. |
or() | Bitwise logical OR of the numerators |
pi(UInt32) | Calculates |
pop() | Removes the value currently on top of the stack. |
pop(Int32) | Removes n values currently on top of the stack. |
popd() | Removes the value currently on top of the stack,
convert and returns it as System.Double value. |
popi() | Removes the value currently on top of the stack,
convert the numerator and returns it as System.Int32 value. |
popr() | Removes the value currently on top of the stack,
convert and returns it as always normalized BigRational number. |
pow(Int32) | Replaces the value on top of the stack with the power of this number to the specified power y. |
pow(Int32, Int32) | Pushes the specified number x raised to the specified power y to the stack. |
push() | Pushes a 0 (zero) value onto the stack. |
push(Decimal) | Pushes the supplied System.Decimal value onto the stack. |
push(Double) | Pushes the supplied System.Double value onto the stack. |
push(Double, Boolean) | Pushes the supplied System.Double value onto the stack using a bit-exact conversion without rounding. |
push(Int32) | Pushes the supplied System.Int32 value onto the stack. |
push(Int32, Int32) | Pushes n copies of the supplied System.Int32 value onto the stack. |
push(Int64) | Pushes the supplied System.Int64 value onto the stack. |
push(BigInteger) | Pushes the supplied System.Numerics.BigInteger value onto the stack. |
push(BigRational) | Pushes the supplied BigRational value onto the stack. |
push(ReadOnlySpan<UInt32>) | Pushes the supplied value onto the stack. |
push(Single) | Pushes the supplied System.Single value onto the stack. |
push(UInt32) | Pushes the supplied System.UInt32 value onto the stack. |
push(UInt64) | Pushes the supplied System.UInt64 value onto the stack. |
rnd(Int32, Int32) | Rounds the value at the top of the stack
to the specified number of fractional decimal digits. |
shl(Int32, Int32) | Selects the value at index i relative to the top of the stack. |
shr(Int32, Int32) | Selects the value at index i relative to the top of the stack. |
sign(Int32) | Gets a number that indicates the sign of the value at index i relative to the top of the stack. |
sin(UInt32, Boolean) | Replaces the value on top of the stack with the sine or cosine of that value. |
sqr(Int32) | Squares the value at index |
sqr(UInt32) | Squares the value at index |
sqrt(UInt32) | Replaces the value on top of the stack with it's square root. Negative values result in NaN. |
sub() | Subtract the first two values on top of the stack and replaces them with the result. |
sub(Int32, Int32) | Subtracts the values at index |
sub(BigRational, BigRational) | Subtracts the values |
sub(UInt32, UInt32) | Subtracts the values at index |
swp() | Swaps the first two values on top of the stack. |
swp(Int32, Int32) | Swaps the values at index |
swp(UInt32) | Swaps the values at index |
swp(UInt32, UInt32) | Swaps the values at index |
tor(ReadOnlySpan<Char>, Int32, Char) | Converts a string to a rational number and pushes the result on the stack. |
tos(Span<Char>, out Int32, out Int32, out Int32, Boolean) | Converts the value on top of the stack to decimal digits. |
xor() | Bitwise logical XOR of the numerators |