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. Thank you... :)
Simple and effective explan

View Tutorial          By: Mohammed Muzammil at 2012-08-08 05:07:32

2. hi....
i want to send sms to any mobile by

View Tutorial          By: prerna at 2010-07-09 20:15:48

3. just looking for it, useful!
View Tutorial          By: ymfeng at 2009-03-20 00:09:56

4. package com.anand;

import java.sql.

View Tutorial          By: Anand at 2012-11-12 00:00:07

5. its a nice site bcoz it gives a bright IDEA about
View Tutorial          By: surya santhan at 2012-07-11 16:28:06

6. Thanks it worked. Just remember to restart apache
View Tutorial          By: Raj at 2014-02-08 08:42:26

7. sorry guys: how can i retrieve a report or large t
View Tutorial          By: aidid at 2013-05-04 06:07:42

8. Very nice demo. thanks! :)
View Tutorial          By: Nikhil Gala at 2012-01-13 10:03:57

9. hey...i have a problem getting the system date in
View Tutorial          By: angel at 2010-04-03 09:27:38

10. hi every body i want full java code to send messag
View Tutorial          By: Ashray P Shetty at 2010-11-09 04:33:45