Jump to content

  • Log In with Google      Sign In   
  • Create Account


Apmyp

Member Since 24 Aug 2012
Offline Last Active Oct 01 2013 06:24 AM
-----

Topics I've Started

Unsigned int64 wokring wrong

24 September 2013 - 04:51 AM

Dear Andreas and all,

 

1) This code will cause an error "Implicit conversion changed sign of value":

uint64 ui64b = 4294967295;

But this won't:

uint64 ui64b = 4294967296;

2) If I declare a global application function like FnTestUint64(uint64 val) and pass ui64b variable to this function, then there are two different behaviours:

 

uint64 ui64b = 4294967295; FnTestUint64(ui64b); // C++ debugger will show incorrect value 0xffffffffffffffff

uint64 ui64b = 4294967296; FnTestUint64(ui64b); // C++ debugger will show correct value 0x0000000100000000

 

0xffffffffffffffff is -1 in int64 and 18446744073709551615 in uint64.

 

It seems that compiler incorrectly converts 4294967295 to int as -1, then converts this -1 to int64, then converts this big -1 (represented as 0xffffffffffffffff) to uint64

 

Maybe it is a well-known bug? Is it possible to fix it?

Thank you.


Preprocessing

24 August 2012 - 04:09 AM

Hello,

I have a few questions about possibility own built-in preprocessing to realize addition functionality.

1) I would like to add #define directive. How can I do this?
2) Is it possible to add some another preprocessor directives?
3) Is it possible to replace not-AS type to built-in type? For example from "unassigned int" to "uint".
4) Is it possible to re-declare arrays from AS-way to C-way. I mean using "int arr[5]" instead of "int[] arr(5)".

Thank you in advance.

PARTNERS