Cody

# Problem 44971. Convert base 10 to base x (2-16)

Solution 1952338

Submitted on 29 Sep 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
dec = [12345.12345,9876.9876]; x = 16; y_correct={'3039.1f9a6b50b','2694.fcd35a8588'}; assert(isequal(dec2basex(dec,x),y_correct))

2   Pass
dec = [12345.12345,9876.9876]; x = 7; y_correct={'50664.0602255245326442','40536.6625141031624663'}; assert(isequal(dec2basex(dec,x),y_correct))

3   Fail
dec= [9626.150562201365,389979.4884571975,981037227081.0962,15.15348748187026,2951227.338373619,409,667123.807,30421.507,7285.4,38.59]; x=2; y_correct={'10010110011010.0010011010001011','1011111001101011011.0111110100001011','1110010001101010011000000001110001001001.00011000101','1111.001001110100101','1011010000100000111011.0101011010011111','110011001','10100010110111110011.1100111010010111','111011011010101.100000011100101','1110001110101.011001100110011','100110.100101110000101'}; assert(isequal(dec2basex(dec,x),y_correct))

Assertion failed.

4   Fail