Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Naming Convention For 0.0 - 1.0 Value Range?

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?

like image 540
Chunky Chunk Avatar asked Dec 22 '22 18:12

Chunky Chunk


2 Answers

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.

like image 154
Femaref Avatar answered Mar 08 '23 08:03

Femaref


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

like image 44
Dr. Snoopy Avatar answered Mar 08 '23 10:03

Dr. Snoopy