Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

half

struct in Unity.Mathematics

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

A half precision float that uses 16 bits instead of 32 bits.

Static Properties

Property Description
MaxValue The maximum finite half value as a single precision float.
MaxValueAsHalf The maximum finite half value as a half.
MinValue The minimum finite half value as a single precision float.
MinValueAsHalf The minimum finite half value as a half.
zerohalf zero value.

Properties

Property Description
value The raw 16 bit value of the half.

Constructors

Constructor Description
halfConstructs a half value from a half value.

Public Methods

Method Description
EqualsReturns true if the half is bitwise equivalent to a given half, false otherwise.
GetHashCodeReturns a hash code for the half.
ToStringReturns a string representation of the half.

Operators

Operator Description
doubleImplicitly converts a half value to a double value.
floatImplicitly converts a half value to a float value.
halfExplicitly converts a float value to a half value.
halfExplicitly converts a double value to a half value.
operator !=Returns whether two half values are not bitwise equivalent.
operator ==Returns whether two half values are bitwise equivalent.