What is the maximum integer value in Flex?

后端 未结 4 754
孤城傲影
孤城傲影 2021-01-18 16:31

I was trying to display a number: 2893604342.00. But, when i am displaying it it is displayed as: -2893604342.

Following is the code snippet ...

avg          


        
4条回答
  •  甜味超标
    2021-01-18 17:07

    integers in flash are 32 bits, so an unsigned int's max value is (2^32)-1, 0xffffff or 4294967295. a signed int's max positive value is (2^(32-1))-1 or 2147483647 (one of the bits is used for the sign). the Number type is 64 bits.

    in order to guarantee space for your result, type the variable to Number and cast the result to Number (or not at all).

    var avg : Number = 0; ... avg += totalData[i][col.dataField] as Number;

提交回复
热议问题