Cody

Problem 1165. Convert double scalar to half-precision floating point (IEEE 754r)

Use MATLAB to convert a scalar double into a half-precision floating point. The return value should be a uint16.

The half-precision floating point format is specified here, and is the source for much of the test suite:

http://en.wikipedia.org/wiki/Half-precision_floating-point_format

This is an implementation in C if you want some inspiration to get started:

http://www.mathworks.com/matlabcentral/fileexchange/23173-ieee-754r-half-precision-floating-point-converter

As other problems related to half-precision are added, I will try to link them here.

Solution Stats

50.0% Correct | 50.0% Incorrect
Last solution submitted on Sep 02, 2015

Solution Comments

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more