Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

XMHALF2 structure

A 2D vector consisting of two half-precision (16bit) floating-point values.

For a list of additional functionality such as constructors and operators that are available using XMHALF2 when you are programming in C++, see XMHALF2 Extensions.

Note   See DirectXMath Library Type Equivalences for information about equivalent D3DDECLTYPE, D3DFORMAT, and DXGI_FORMAT objects.


struct XMHALF2 {
  HALF x;
  HALF y;



HALF value describing the x-coordinate.


HALF value describing the y-coordinate.


The definition of the HALF type used under DirectXMath is consistent with the IEEE standard, and consists of a sign bit, a 5 bit biased exponent, and a 10 bit mantissa:

                    [15] SEEEEEMMMMMMMMMM [0]

XMHALF2 can be loaded into instances of XMVECTOR by using XMLoadHalf2.

Instances of XMVECTOR can be stored into an instance of XMHALF2 with XMStoreHalf2.

Namespace: Use DirectX::PackedVector

Platform Requirements

Microsoft Visual Studio 2010 or Microsoft Visual Studio 2012 with the Windows SDK for Windows 8. Supported for Win32 desktop apps, Windows Store apps, and Windows Phone 8 apps.




See also

DirectXMath Library Structures
XMHALF2 Extensions



© 2016 Microsoft