Returns the digits of a number given the basis.
digits = lowdisc_bary ( n ) digits = lowdisc_bary ( n , basis ) digits = lowdisc_bary ( n , basis , order )
a 1 x 1 matrix of floating point integers, the integer to decompose
a 1 x 1 matrix of floating point integers, the basis. Default basis = 2.
a string, the order of the digits. If order="littleendian", then the least significant digits are at the end. If order="bigendian", then the biggest significant digits are at the begining. Default is order="littleendian".
a n x 1 matrix of floating point integers, the digits of the decomposition. The i-th digit satisfies 0<= digit(i) <= b - 1
Returns the list of digits of the decomposition of n in base b, i.e. decompose n as n = d0 b^jmax + d1 b^{jmax-1} + ... + d{jmax+1} b^0. The order is little endian order, i.e. the first digit is associated with b^jmax, and the last digit is associated with b^0.
This function is not vectorized, that is, it converts only one integer at a time.
lowdisc_bary ( 4 , 2 ) // [1 0 0]' lowdisc_bary ( 4 , 2 , "bigendian" ) // [0 0 1]' lowdisc_bary ( 4 , 2 ) // [1 0 0]' lowdisc_bary ( 4 , 2 , "littleendian" ) // [1 0 0]' lowdisc_bary ( 4 , 2 , "bigendian" ) // [0 0 1]'
"Monte-Carlo methods in Financial Engineering", Paul Glasserman