Connectivity Software User's Guide and Reference
FindNarrowestNumberType Method



OpcLabs.EasyOpcUAPrimitives Assembly > OpcLabs.EasyOpc.UA Namespace > UAType Class : FindNarrowestNumberType Method
The value or array to analyze. Can be a scalar or multidimensional array.

The value of this parameter cannot be null (Nothing in Visual Basic).

Finds the narrowest floating-point .NET type that can represent the specified value or array of values.
Syntax
'Declaration
 
<JetBrains.Annotations.NotNullAttribute()>
Public Shared Function FindNarrowestNumberType( _
   ByVal value As Object _
) As Type
'Usage
 
Dim value As Object
Dim value As Type
 
value = UAType.FindNarrowestNumberType(value)
[JetBrains.Annotations.NotNull()]
public static Type FindNarrowestNumberType( 
   object value
)
[JetBrains.Annotations.NotNull()]
public:
static Type^ FindNarrowestNumberType( 
   Object^ value
) 

Parameters

value
The value or array to analyze. Can be a scalar or multidimensional array.

The value of this parameter cannot be null (Nothing in Visual Basic).

Return Value

The narrowest floating-point type (Single or Double) that can hold all values, preserving array rank if applicable.

This method never returns null (Nothing in Visual Basic).

Remarks

This method determines whether Single (32-bit) or Double (64-bit) precision is required to represent the value(s). For arrays, it examines all elements and returns an array type of the appropriate rank.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also