Lesson11(타입캐스팅)
형변환
This would cause the correct values to be stored in visits_per_year. Can you think of another solution to this problem (in this case)?
이 경우 나이는 100 단위 이상 넘어가는 경우가 없으므로(아마도)
100을 곱하여 나누면 더 작은 저장범위를 사용하면서도 값을 뽑아낼수 있다. (물론 정수 범위안에서)
방문횟수가 1.4 같은 소수점이 나오지는 않겠지만 1~2번 정도인지는 알수 있을것이다.
백분율을 사용하거나 이백분율을 사용하는 것도 방법일것같다. 0.5 같은 것을 판단하기위한..
Last updated
Was this helpful?