开发者

Naming Convention For 0.0 - 1.0 Value Range?

开发者 https://www.devze.com 2023-02-07 23:57 出处:网络
with naming variables i\'d like to be as clear as possible. a percentage can range from 0 and 100. 开发者_开发百科 my public variable only accepts values between 0.0 and 1.0, so naming it a \"percent

with naming variables i'd like to be as clear as possible.

a percentage can range from 0 and 100. 开发者_开发百科 my public variable only accepts values between 0.0 and 1.0, so naming it a "percentage" can lead to confusion and simply naming it a "value" will not clarify the range limit.

is there a "percent" equivalent or naming convention for variables representing values that range from 0.0 and 1.0?


0.0 to 1.0 is percentage as well. You didn't get your definition right, a percentage range from 0% to 100% or from 0.0 to 1.0. It means the same thing, the % means percent = per cent = per hundred.

The range of 0.0 to 1.0 is normally used in statistics, while the range of 0% to 100% is more found in general life as people can put their mind around it better.


OpenGL uses the "normalized" term for values in the [0, 1] range.

0

精彩评论

暂无评论...
验证码 换一张
取 消