C# 클래스 Evbpc.Framework.Utilities.Extensions.NumericExtensions

A collection of methods which may be used to assist in conversions from certain numeric types to others.
파일 보기 프로젝트 열기: EBrown8534/Framework

공개 메소드들

메소드 설명
FloatToUInt16 ( float value, byte decimalBits ) : ushort

Converts a float value to a rounded ushort, with the specified number of decimals.

GetUShortMask ( byte bits ) : ushort

Constructs a mask which can be used for FloatToUInt16(float, byte) and UInt16ToFloat(ushort, byte).

UInt16ToFloat ( ushort value, byte decimalBits ) : float

Converts a rounded ushort value to a float, with the specified number of decimals.

메소드 상세

FloatToUInt16() 공개 정적인 메소드

Converts a float value to a rounded ushort, with the specified number of decimals.
public static FloatToUInt16 ( float value, byte decimalBits ) : ushort
value float The float value to convert.
decimalBits byte The number of bits in the ushort value which represent decimals.
리턴 ushort

GetUShortMask() 공개 정적인 메소드

Constructs a mask which can be used for FloatToUInt16(float, byte) and UInt16ToFloat(ushort, byte).
public static GetUShortMask ( byte bits ) : ushort
bits byte The number of bits that should be set in the mask.
리턴 ushort

UInt16ToFloat() 공개 정적인 메소드

Converts a rounded ushort value to a float, with the specified number of decimals.
public static UInt16ToFloat ( ushort value, byte decimalBits ) : float
value ushort The ushort value to convert.
decimalBits byte The number of bits in the ushort value which represent decimals.
리턴 float