Cody

Solution 2128859

Submitted on 14 Feb 2020 by David Hill
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
assert(isequal(dec2bin_frac(123.25),'1111011.01'))

2   Pass
assert(isequal(dec2bin_frac(123.2,6),'1111011.001100'))

3   Pass
assert(isequal(dec2bin_frac(6.97,10), '110.1111100001'))

4   Pass
assert(isequal(dec2bin_frac(61.81250),'111101.1101'))

5   Pass
assert(isequal(dec2bin_frac(666),'1010011010'))

6   Pass
assert(isequal(dec2bin_frac(666624.5),'10100010110000000000.1'))

7   Pass
assert(isequal(dec2bin_frac(55.125,7),'110111.001'))

8   Pass
assert(isequal(dec2bin_frac(123),'1111011'))

Suggested Problems

More from this Author122