Number type conversion issue

Discussions related to Visual Prolog
Martin Meyer
VIP Member
Posts: 280
Joined: 14 Nov 2002 0:01

Number type conversion issue

Unread post by Martin Meyer » 15 Oct 2013 19:14

Hello Thomas, hi all,

I found, that the compiler (7.4 build 7402) does not accept these constant declarations:

Code: Select all

constants     lowerIntegerU8 = uncheckedConvert(unsigned8, lowerbound(integer8)).     lowerIntegerU16 = uncheckedConvert(unsigned16, lowerbound(integer16)).
But with larger types it is working fine:

Code: Select all

constants     lowerIntegerU = uncheckedConvert(unsigned, lowerbound(integer)).     lowerIntegerU32 = uncheckedConvert(unsigned32, lowerbound(integer32)).     lowerIntegerU64 = uncheckedConvert(unsigned64, lowerbound(integer64)).     lowerIntegerUNative = uncheckedConvert(unsignedNative, lowerbound(integerNative)).
Many regards,
Martin

User avatar
Thomas Linder Puls
VIP Member
Posts: 1172
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 16 Oct 2013 18:58

Thank you, for letting us know, we will of course solve the problem (but with low priority).

Though the code seems a bit silly you can write like this:

Code: Select all

constants     lowerIntegerU8 = uncheckedConvert(unsigned8, convert(integer8, lowerbound(integer8))).     lowerIntegerU16 = uncheckedConvert(unsigned16, convert(integer16, lowerbound(integer16))).
Regards Thomas Linder Puls
PDC

Post Reply