Uint32

conversion-functions uint32

concept

  1. uint32 is a 32 bits (4 bytes) unsigned integer value-type.
  2. uint32() is a function converting data items or units of other value types to the uint32 value type.

This page describes the uint32() function.

syntax

description

The uint32() function may be used to denote a literal to a uint32 value type but this is not necessary, as literals are by default considered as uint32.

definition

uint32(a) results in a 32 bits(4 bytes) unsigned integer item converted from item a. The function results for:

  • integer data items: the integer value is interpreted as uint32 value, if the value exceeds the allowed value range for the uint32 value type, the resulting value will be null;
  • float32/64 data items: the value before the decimal point (so 1.9 will be rounded off to 1 and 2.0 to 2). If the value exceeds the allowed value range for the uint32 value type, the resulting value will be null;
  • boolean data items: 1 for True values and 0 for False values;
  • string data items, if the value starts with an allowed numeric value for the value type, this value is converted to a uint32 value type. Other characters after the numeric values are ignored. If the string does not start with an allowed numeric value for the value type, the resulting value will be null;
  • units, a 32 bits(4 bytes) unsigned integer unit of the converted unit.

applies to

  • data item or unit with Numeric, uint2, uint4, bool or string value type

since version

  • 5.15
  • u suffix: since 7.105

example

1. parameter<uint32>; uint32Numeric1 := uint32(1);
2. parameter<uint32>; uint32Numeric1 := 1u;

3. attribute<uint32> uint32A (ADomain) := uint32(A);
4. attribute<uint32> uint32B (ADomain) := uint32(B);
A(float32) B(string) uint32A uint32B
0 ‘Hello’ 0 null
1 ‘Test’ 1 null
1000000 null 1000000 null
-2.5 ‘Two words’ null null
99.9 ‘88a’ 99 88

ADomain, nr of rows = 5