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



Subscribe to Tutorials

Related Tutorials

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

Java program using Method Overriding

Archived Comments

1. BIG Thanks for such wonderful tutorial :) :) :)
View Tutorial          By: dhruva at 2013-07-10 08:56:27

2. Hi, Please let me know how to implement this progr
View Tutorial          By: Mukul Chadha at 2011-06-29 09:13:28

3. I am deveolper in envision .i am interested in scj
View Tutorial          By: shiva kumar at 2013-02-20 05:51:42

4. hi, this is a good example and this rely helpful i
View Tutorial          By: Dhaval PATOLIYA at 2015-09-08 06:55:38

5. this helps a lot
View Tutorial          By: Ashar at 2010-04-28 04:47:36

6. Hi,
I wann to insert data into excel file b

View Tutorial          By: PRUTHVIRAJ RATHOD at 2011-05-23 11:42:14

7. In Step 2, I was getting this error: 'The term 'Co
View Tutorial          By: Geneie at 2012-11-22 02:28:13

8. where i can find Messageressourse.properties......
View Tutorial          By: sanjiv at 2013-09-07 06:59:19

9. can you guys please help me in inserting values on
View Tutorial          By: Fariha at 2015-06-15 20:44:04

10. Hallo.

And if the certificate is se

View Tutorial          By: Mario at 2009-11-11 08:42:46