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. @Brian You surely can deploy your server code clas
View Tutorial          By: Ayush at 2013-06-10 13:22:38

2. thanks for this good example. i got error like (th
View Tutorial          By: anandhi at 2009-12-20 09:32:45

3. hi
Instead of sending a int type pass an ar

View Tutorial          By: Sanju at 2014-12-04 08:51:18

4. Awesome tutorial
View Tutorial          By: Anonymous at 2012-12-13 06:50:36

5. hello after working with this code i got the follw
View Tutorial          By: Tapaswini Sabat at 2011-11-05 12:43:49

6. Hi I am developing a code for data transfer from
View Tutorial          By: Rajavel at 2014-03-21 14:17:54

7. OK 0
COM1
javax.comm.CommPortIdenti

View Tutorial          By: sruthi at 2013-01-20 10:37:41

8. Very good example .. i ve written this program . P
View Tutorial          By: gomz at 2011-09-26 12:33:54

9. what are the basic requirements to send sms from p
View Tutorial          By: kanagarajan at 2008-01-02 07:52:44

10. Nice example.
I got it finally
Thank

View Tutorial          By: Bo at 2015-05-05 06:28:43