Comment on Tutorial - float vs double data types in Java By Baski



Comment Added by : George

Comment Added at : 2015-01-31 06:25:18

Comment on Tutorial : float vs double data types in Java By Baski
Hi Robert,

The precision statement applies to numbers that have a large number of digits on either or both sides of the decimal point. The range of the opacity value is 0 to 1, which granted, could contain a value that exceed the floats ability to precisely hold it, but you would never be able to tell the difference and I would be quite surprised to find that value ever used in iterative calculations. By turning it into a percentage it may be easier to see why. The opacity can be set from 0% to 100%. So if you want to change it from 64% to 63% for example, the float would be .63 and doesn't need any more precision than that as your eye would have great difficulty seeing any discernible difference beyond that. Even if you got really picky and wanted to be able to set your opacity to 63.937364 percent and for another object set it to 63.937365 you would #1 - never ever be able to tell the difference and #2 - you will still not have come even close to exceeding that precision for which the float is capable of holding.


View Tutorial



Related Tutorials

Java program to get location meta data from an image

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Archived Comments

1. Explanation is very good. Thanks all.
View Tutorial          By: reddy at 2010-04-07 08:47:09

2. thanx a lot for this tutorial brother!!!!! a great
View Tutorial          By: manas at 2013-04-01 17:18:00

3. Hello,

I got an error like (Wed Ma

View Tutorial          By: narayanan at 2010-03-17 05:56:21

4. I tried running this code.. I used motorazr v3i as
View Tutorial          By: Arvind at 2009-02-14 10:24:37

5. And how did you do that ?
Can you share it

View Tutorial          By: Arsenio at 2009-07-18 23:01:00

6. array is the one which can save similar data typed
View Tutorial          By: Cegonsoft Reviews at 2011-07-26 00:54:18

7. I writing a main class in the eclipse IDE and call
View Tutorial          By: adam lim at 2013-03-11 04:13:51

8. good Article!! you can add context settings in app
View Tutorial          By: Amit Nigam at 2009-06-10 07:35:20

9. php-cgi.exe return popup "is not a valid Win3
View Tutorial          By: noob at 2013-06-30 09:47:38

10. The code is really helpfull...
reading or w

View Tutorial          By: sharda at 2010-03-11 03:28:02