Cody

# Problem 832. Convert single-precision floating-point number to binary representation

Solution 114367

Submitted on 18 Jul 2012
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   Fail
%% x = single(1.25); y_correct = '00111111101000000000000000000000'; assert(isequal(single2bin(x),y_correct))

```Error: License checkout failed. License Manager Error -5 Cannot find a license for Fixed_Point_Toolbox. Make sure an INCREMENT line for Fixed_Point_Toolbox exists in the license file, and that the formatting of the license file is correct. Troubleshoot this issue by visiting: <a href="http://www.mathworks.com/support/lme/R2012a/5">http://www.mathworks.com/support/lme/R2012a/5</a> Diagnostic Information: Feature: Fixed_Point_Toolbox License path: 13501@10.206.97.41:13501@10.10.207.33:/tmp/matlabpref/.matlab/R2012a_licenses:/opt/mlsedu/matlab/R2012a/licenses/license.dat:/opt/mlsedu/matlab/R2012a/licenses Licensing error: -5,0. ```

2   Fail
%% x = realmax('single'); y_correct = '01111111011111111111111111111111'; assert(isequal(single2bin(x),y_correct))

```Error: License checkout failed. License Manager Error -5 Cannot find a license for Fixed_Point_Toolbox. Make sure an INCREMENT line for Fixed_Point_Toolbox exists in the license file, and that the formatting of the license file is correct. Troubleshoot this issue by visiting: <a href="http://www.mathworks.com/support/lme/R2012a/5">http://www.mathworks.com/support/lme/R2012a/5</a> Diagnostic Information: Feature: Fixed_Point_Toolbox License path: 13501@10.206.97.41:13501@10.10.207.33:/tmp/matlabpref/.matlab/R2012a_licenses:/opt/mlsedu/matlab/R2012a/licenses/license.dat:/opt/mlsedu/matlab/R2012a/licenses Licensing error: -5,0. ```

3   Fail
%% x = realmin('single'); y_correct = '00000000100000000000000000000000'; assert(isequal(single2bin(x),y_correct))

```Error: License checkout failed. License Manager Error -5 Cannot find a license for Fixed_Point_Toolbox. Make sure an INCREMENT line for Fixed_Point_Toolbox exists in the license file, and that the formatting of the license file is correct. Troubleshoot this issue by visiting: <a href="http://www.mathworks.com/support/lme/R2012a/5">http://www.mathworks.com/support/lme/R2012a/5</a> Diagnostic Information: Feature: Fixed_Point_Toolbox License path: 13501@10.206.97.41:13501@10.10.207.33:/tmp/matlabpref/.matlab/R2012a_licenses:/opt/mlsedu/matlab/R2012a/licenses/license.dat:/opt/mlsedu/matlab/R2012a/licenses Licensing error: -5,0. ```

4   Fail
%% x = single(-1.625e21); y_correct = '11100010101100000010111011001111'; assert(isequal(single2bin(x),y_correct))

```Error: License checkout failed. License Manager Error -5 Cannot find a license for Fixed_Point_Toolbox. Make sure an INCREMENT line for Fixed_Point_Toolbox exists in the license file, and that the formatting of the license file is correct. Troubleshoot this issue by visiting: <a href="http://www.mathworks.com/support/lme/R2012a/5">http://www.mathworks.com/support/lme/R2012a/5</a> Diagnostic Information: Feature: Fixed_Point_Toolbox License path: 13501@10.206.97.41:13501@10.10.207.33:/tmp/matlabpref/.matlab/R2012a_licenses:/opt/mlsedu/matlab/R2012a/licenses/license.dat:/opt/mlsedu/matlab/R2012a/licenses Licensing error: -5,0. ```