Re: [Vala] Why is 77 greater than 4294967295?



Thanks, for the replys.

Finishing a Vala project, I started 3 years ago.

The Rexx data type and functions for the GObject system.

Just writing unit tests and working out bugs.

I am working with unichar in Vala.

From Wikipedia,

"Unicode 11.0, contains a repertoire of 137,439 characters" - "For Now"

My data is a number in string form.

example "77", "+77"

I convert that back to number using a to_long function.

From Wikipedia C data types,
"unsigned int  Contains at least the [0, 65,535]" will not get all my Unicode

To avoid,

"The unsigned int is converted to long and the maximum unsigned long is a negative signed long."

var i = this.to_long ();

//if ((i < uint.MIN) | (i > uint.MAX)) {

// OK TO HARD CODE? - I JUST NEED POSITIVE NUMBER INSIDE the "137,439 characters"
//  to catch errors and works on 32 and 64 BIT.
// Do not see my code running on 8 or 16 BIT and Unicode with 4294967295 chars.

if ((i < 0) | (i > 2147483647)) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]