- Sizes
Integer Types (int, long and long long)
Size of Boolean type is 1 byte(s)
Number of bits in a character: 8 Size of character types is 1 byte Signed char min: -128 max: 127 Unsigned char min: 0 max: 255 Default char is unsigned
Size of short int types is 2 bytes Signed short min: -32768 max: 32767 Unsigned short min: 0 max: 65535
Size of int types is 4 bytes Signed int min: -2147483648 max: 2147483647 Unsigned int min: 0 max: 4294967295
Size of long int types is 4 bytes Signed long min: -2147483648 max: 2147483647 Unsigned long min: 0 max: 4294967295
Size of long long types is 8 bytes Signed long long min: -9223372036854775808 max: 9223372036854775807 Unsigned long long min: 0 max: 18446744073709551615 Note that int and long are the same size and if you want a 64 bit integer then you need to use long long (or unsigned long long).
- What do you want to achieve with
.
CS=30.10 // 30.10
Int_CS=int(CS) // 30
FLOAT_CS = (Int_CS-CS)*100 //-10.00 because 30 - 30.10 = -0.1 and -0.1 * 100 = -10.00
CS is already float, why you want to convert it to int and back to float? If value of int is higher than 255 you have to save it in 2 bytes(highByte and lowByte), float is 32bit(4bytes) value.
I think you have to do like this:
float CS = 30.10;
au16data[0]= (int)(CS*100);//3010.00 > 3010
And for better way use :
float auFloatData[30]; //
...
auFloatData[0]=Current_Value1[0];