unsigned 64 bit integer not available

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

unsigned 64 bit integer not available

1,467件の閲覧回数
deneb
Contributor II

Hello

 

I am trying to use unsigned 64bit integer on an HCS12, as e.g.,

 

unsigned long long var1

 

But it turns out that it is always allocated as 32 bit unsigned. Upon checking the "Type Sizes" in the compiler options, I see that "long long" is declared as 32-bits. I cannot change it to 64-bits because that column is disabled.

Any ideas on how to overcome this issue?

 

Thanks

deneb

ラベル(1)
0 件の賞賛
返信
1 返信

724件の閲覧回数
kef
Specialist I

You could do your own 64bit integer routines. These should be available on the net.

 

If execution time isn't issue and 52bits (0..+-2^52) are enough, then just use double instead of long long. Result of *-+/ should be the same, except that int/int may introduce fractional part and different behaviour on overflows.

 

Request imrpovement.

0 件の賞賛
返信