Home » U++ Library support » U++ Core » What happened to long ints?
Re: What happened to long ints? [message #1721 is a reply to message #1720] |
Wed, 15 March 2006 19:58   |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
tercero12 wrote on Wed, 15 March 2006 13:35 |
luzr wrote on Wed, 15 March 2006 11:52 |
Well, it is true that number of fundamental types that can be directly stored into Value is deliberately limited to bool, int, double and int64.
In practice, however, the question is why do you need to store long int? If you just want to store 32-bit value, use "int" (typecast if you source contains long). In U++ int is required to have at least 32 bits. If you need 64, use int64.
Mirek
|
I mentioned that I'm doing this for a school assignment. Part of the assignment is that the "computer" that we are emulating has 32-bit registers. This is fine and I could use ints or int64s but when I use EditInt, it just can't seem to handle 2^32 unique values. I guess this may be the real rub. Thoughts?
|
I see. You need unsigned, what you get is signed with Null, right?
I guess, the right solution is to define Convert using int64, limit it to unsigned 0-2^32 range, use its regular Null if needed. Use this Convert to customize your editfield (you can also learn it other useful things like hexadecimal syntax etc...)
Mirek
|
|
|
Goto Forum:
Current Time: Mon Aug 25 21:06:10 CEST 2025
Total time taken to generate the page: 0.06430 seconds
|