Quite often I use values between 0.0 and 1.0 to hold progress, or transparancy, or other things that can go from none to full. A percentage if you will.
I don't want to call it a percentage because it is not expressed as a value from 0 to 100.
To give my variables a clear name, I still would like to describe this kind of value.
What would be an appropriate name?
The closed range between [0,1] is typically called the closed unit interval. If you do not include the endpoints it would be the open unit interval.
random() method returns a random float number between 0.0 to 1.0. The function doesn't need any arguments.
To convert a number range to another range, maintaining the ratio the simple way would be use linear conversion.
Use en dash (not hyphen or em dash) with no spaces either side. Use all the digits (so no elision) if at least one number in the range is from 1 to 100, e.g. 2–10, 67–69, 82–323. For multiples of 100, use all the digits, e.g. 100–107, 300–329, 2,200–2,254.
That is called a normalized value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With