Subscribed unsubscribe Subscribe Subscribe

int() / byte() / float()

processing_Sample

int()
int() \ Language (API) \ Processing 2+

convert
primitive datatype to integer

float f = 65.0;
int i = int(f);
println(f+" : " +i);
// console: 65.0 : 65

char c = 'E';
i = int(c);
println(c+ " : " +i);
// console: E : 69


byte()
byte() \ Language (API) \ Processing 2+

convert
primitive datatype to byte

char c = 'E';
byte b = byte(c);
println(c+" : "+b);

int i = 130;
b = byte(i);
println(i+" : "+b);


float()
float() \ Language (API) \ Processing 2+

convert
primitive type to float

int i = 65;
float f = float(i);

println(i+" : "+f);
// console: 65 : 65.0