java - Seven_segment possible loss precision -
this code display 7 segment there problem calle possible loss of precision in code. please me solve this
void computedisplayvalue(string value){ sevenseg.numdigits = 5; long temp = long.parselong(value.substring(0,1)); sevenseg.displayvalue[0] = sevenseg.segmentmap[ temp ]; temp = long.parselong(value.substring(1,2)); sevenseg.displayvalue[1] = sevenseg.segmentmap[ temp ]; temp = long.parselong(value.substring(2,3)); sevenseg.displayvalue[2] = sevenseg.segmentmap[ temp ]; temp = long.parselong(value.substring(3,4)); sevenseg.displayvalue[3] = sevenseg.segmentmap[ temp ]; temp = long.parselong(value.substring(4,5)); sevenseg.displayvalue[4] = sevenseg.segmentmap[ temp ];*/ /* suppress leading 0 in 12 hour mode */ }
change long
, long
int
, integer
respectively.
array indexes integers, can't longs. hence error when
sevenseg.segmentmap[temp]
Comments
Post a Comment