Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
RokuKC
Roku Employee
Roku Employee

Re: creepycrawler?

"Romans_I_XVI" wrote:

...

I thought that the hex constant &h was just a representative of a decimal intiger, as in &hFFFFFFFF = 4294967295 (http://sdkdocs.roku.com/display/sdkdoc/ ... +Reference Section 3.3). Maybe I was completely wrong. Either way 4294967295 gives me a tinted red bitmap where &hFFFFFFFF gives me what I expected.

...


There are some somewhat subtle issues with respect to specifying integer constants and how type conversions and limit checks are performed.

Hex constants can represent a full 32-bit unsigned range of integers (0 .. &hFFFFFFFF - 4,294,967,295), as overlaid on a 32-bit signed integer variable. Values outside that range get clipped to 32-bits.

Integer constants should represent a full 32-bit signed range, but the current behavior is to only represent integer -999,999,999 .. 999,999,999. Values outside that range get implicitly promoted to type Double.

However, if you pass that Double value to an integer-typed parameter, or assign it to an integer-typed variable, it goes through a narrowing conversion back to signed integer. The value is out of range and in this case happens to be converted to an out of range value &h80000000, which happens to look like a reddish color value.
0 Kudos
Romans_I_XVI
Roku Guru

Re: creepycrawler?

Oh, thanks for the in depth explanation RokuKC.
0 Kudos