PINE LIBRARY
Atualizado BinaryDecimalConversion

Library "BinaryDecimalConversion"
Converts decimal to and from binary.
to_binary(number) convert integer to binary string
Parameters:
Returns: string
to_decimal(binary) Converts a binary in a string to decimal.
Parameters:
Returns: int
Converts decimal to and from binary.
to_binary(number) convert integer to binary string
Parameters:
- number: int, value to convert.
Returns: string
to_decimal(binary) Converts a binary in a string to decimal.
Parameters:
- binary: string, binary number in a string.
Returns: int
Notas de Lançamento
v2 Binary shift methods, they are a bit demanding tho :s .Added:
leftshift_logical(x, n)
Shift the bits of an integer to the left.
Parameters:
x: int . Value to shift.
n: int . Number of zeros to append to x.
Returns: int.
Notas de Lançamento
v3 missed some exports..Added:
rightshift_logical(x, n)
Shift the bits of an integer to the right.
Parameters:
x: int . Value to shift.
n: int . Number of bits to remove at the right of x.
Returns: int.
leftshift_arithmetic(x, n)
Shift the bits of an integer to the left.
Parameters:
x: int . Value to shift.
n: int . Number of zeros to append to x.
Returns: int.
leftshift_arithmetic () {
reference:
stackoverflow.com/questions/5832982/how-to-get-the-logical-right-binary-shift-in-python
rightshift_arithmetic(x, n)
Shift the bits of an integer to the right.
Parameters:
x: int . Value to shift.
n: int . Number of bits to remove at the right of x.
Returns: int.
Notas de Lançamento
v4 correcting a greasy finger :P, /lastonehesaid..Updated:
leftshift_arithmetic(x, n)
Shift the bits of an integer to the left.
Parameters:
x: int . Value to shift.
n: int . Number of zeros to append to x.
Returns: int.
Biblioteca do Pine
No verdadeiro espirito do TradingView, o autor desse código Pine o publicou como uma biblioteca de código aberto, para que outros programadores Pine da nossa comunidade possam reusa-los. Parabéns ao autor! Você pode usar essa biblioteca privadamente ou em outras publicações de código aberto, mas a reutilização desse código em publicações é regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Biblioteca do Pine
No verdadeiro espirito do TradingView, o autor desse código Pine o publicou como uma biblioteca de código aberto, para que outros programadores Pine da nossa comunidade possam reusa-los. Parabéns ao autor! Você pode usar essa biblioteca privadamente ou em outras publicações de código aberto, mas a reutilização desse código em publicações é regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.