Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


half

A half precision float that uses 16 bits instead of 32 bits.
Read time 1 minuteLast updated 7 days ago

Definition

public struct half : IEquatable<half>, IFormattable

Fields

Value

Description

valueThe raw 16 bit value of the half.

Static Fields

Value

Description

zerohalf zero value.

Constructors

Constructor

Description

half(System.Double)Constructs a half value from a double value.
half(System.Single)Constructs a half value from a float value.
half(Unity.Mathematics.half)Constructs a half value from a half value.

Static Properties

Property

Description

MaxValueThe maximum finite half value as a single precision float.
MaxValueAsHalfThe maximum finite half value as a half.
MinValueThe minimum finite half value as a single precision float.
MinValueAsHalfThe minimum finite half value as a half.

Methods

Method

Description

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

Operators

Operator

Description

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