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

42 Solutions

8 Solvers

Last Solution submitted on May 26, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers8

Suggested Problems

More from this Author2

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!