Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners possible loss of precision

Have Programming Question? Ask it here!
 
 
 


gauthami
possible loss of precision
1 Answer(s)      3 years and 7 months ago
Posted in : Java Beginners


{ int amount=(int)depositAmount;

    switch (depositAmount)
    {
  case(depositAmount<=depAmount1):
      intrest=(depositAmount*1*rate1);
    break;
      case(depositAmount>=depAmount1 && depositAmount<=depAmount2):
      intrest=(depositAmount*1*rate2);
    break;
      case(depositAmount>depAmount2):
      intrest=(depositAmount*1*rate3);
    break;
    return intrest;
    System.out.println("the intrest is" +intrest);
    }

i have possible loss of precision as my error


Advertisement
View Answers

December 13, 2010 at 12:32 PM


Hi Friend,

Do not convert double value to int.

Thanks



Related Tutorials/Questions & Answers:
possible loss of precision error
possible loss of precision error  how do i fix this error " possible loss of precision found int required char ch = input.read()" this is the code import java.io.InputStreamReader; import java.io.IOException; class Test1
possible loss of precision
is" +intrest); } i have possible loss of precision as my error...possible loss of precision  { int amount=(int)depositAmount; switch (depositAmount) { case(depositAmount<=depAmount1
Advertisements
Precision
Precision  HII, What is precision?   hello, Precision refers the accuracy of the decimal portion of a value. Precision is the number of digits allowed after the decimal point
it possible or not
it possible or not  without public static void main(string args[]) in java program it is possible
Weight loss
Weight loss   Is anybody able to help me. I am wanting to build... and output weight loss given time spent on activities import java.util.*; public... //calculate calories burnt //calculate weight loss //output
losing precision converting from java BigDecimal to double
losing precision converting from java BigDecimal to double  losing precision converting from java BigDecimal to double
Weight Loss
Weight Loss Here we are providing complete information on Obesity and weight loss. This information will guide you in finding the right way in weight loss.... We are also discussing about Weight Loss surgery. There are many advantages
Is it possible in SWT ?
Is it possible in SWT ?  I want drop down like google search (ie, when we type one letter then the word start with that are displayed). when the drop down list appear, then we can select one of word as our text box value. Can i
can a volatile memory loss data on power cut
can a volatile memory loss data on power cut  Can a volatile memory loss ache and main memory content on power cut?   In Volatile, Cache and main memory will lose their contents when the power is off
Weight Loss Surgery Side Effects
Weight Loss Surgery Side Effects Though Weight loss surgery also known... and body. But they want to look good. Both of these things are not possible... Bariatric surgery or Weight loss surgery. The size of stomach is reduced
Weight loss by Ayurveda
Weight loss by Ayurveda There are many ways to loose weight but there has been... weight. Ayurveda weight loss method includes a balanced diet, Yoga and meditation. There are no medicines involved and there are no side effects to weight loss
Java bigdecimal precision example
Java bigdecimal precision example       In this example, bigdecimal class precision method... the method : public int precision() BigDecimal objects with names x
JSP-parameters possible ways
JSP-parameters possible ways  In a JSP program called books.jsp, the Java code out.print(request.getParameter(‚??number‚??)); displays ‚??1111111‚??. What are the ways for the parameter number to have got its value
JSP-parameters possible ways
JSP-parameters possible ways  In a JSP program called books.jsp, the Java code out.print(request.getParameter(‚??number‚??)); displays ‚??1111111‚??. What are the ways for the parameter number to have got its value
Is it possible to upgrade mysql 5.1 to 5.5
Is it possible to upgrade mysql 5.1 to 5.5  Is it possible to upgrade mysql 5.1 to 5.5
Hi Friend..IS IT POSSIBLE? - Java Beginners
Hi Friend..IS IT POSSIBLE?  Hi Friend...Thank u for ur valuable response.. IS IT POSSIBLE FOR US? I need to display the total Number od days... 2008 MONTH 8 DAYS: 8 TOTAL NUMBER OF DAYS : _____ IS IT POSSIBLE FOR US
is it possible to use jsp in java script
is it possible to use jsp in java script  is it possible to use jsp inside the javascript while using java script in body tag on that time i am calculate number of records in mysql, so that i am using jsp.if count value
is it possible to use jsp in java script
is it possible to use jsp in java script  is it possible to use jsp inside the javascript while using java script in body tag on that time i am calculate number of records in mysql, so that i am using jsp.if count value
array find all possible dimension
array find all possible dimension  Given array: int[] dimension = { 1, 2, 3 }; That produces the output: 1 2 3 12 13 23 123 I'm new to array...i can't figure out the way on even how to start... any idea?...really appreaciate
Shortest the program as possible but output will not change
Shortest the program as possible but output will not change  #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #define MAX_BUF 50 // Size of the buffer to hold intermediate
Shortest the program as possible but output will not change
Shortest the program as possible but output will not change  #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #define MAX_BUF 50 // Size of the buffer to hold intermediate
is it possible to connect the multiple databases from the hibernate application
is it possible to connect the multiple databases from the hibernate application  is it possible to connect the multiple databases from the hibernate application,if it is possible then tell me with step wise manner
i have no programming knowledge is it possible for study java?
i have no programming knowledge is it possible for study java?  hello sir i have no programming knowledge is it possible to study java and jsp and servlet and struts.if it is then how i schedule for this and how to study
Incrementing a Double by the Smallest Possible Amount
Incrementing a Double by the Smallest Possible Amount In this section, you will earn how to increment the double value by the smallest possible amount... by the smallest possible amount, we have invoked the previousDouble() method of ChoiceFormat
Possible ways to Retrieve Data - Development process
Possible ways to Retrieve Data   Hi Deepak, Can u explain me, how manys we can retrive data from database. am confused with ,1)using beans like set property and get property 2)using JSTL tags and apart frm
how to print all possible combination that sum to zero??
how to print all possible combination that sum to zero??  √?¬ Consider the sequence of digits from 1 through N (N<=9) in increasing order: 1 2 3.... Print all possible combinations that sum to zero Example Enter a num : 7 1
is it possible to display page in full frame...after dividing page into frames...and is it possible to close frame
is it possible to display page in full frame...after dividing page into frames...and is it possible to close frame  ... full page view is it possible?? is there any option to close the frame
Is It Possible To Make $5,000 By Writing Just One Article?
Is It Possible To Make $5,000 By Writing Just One Article?       In today's competitive market, it is not uncommon to hear of huge earning opportunities in even the humblest
javascript:getElementByClassname:Is it possible to collect all the elements with same classname
javascript:getElementByClassname:Is it possible to collect all the elements with same classname  Is it possible to collect all the elements with same classname in a array n display the array by using getElementByClassname
is it possible to add a button inside an autocomplete jquery ui plugin?
is it possible to add a button inside an autocomplete jquery ui plugin?  is it possible to add a button inside an autocomplete jquery ui plugin? My requirement: I have a 4 text input fields that I want to implement autocomplete
Itried all possible ways still getting thesame error
Itried all possible ways still getting thesame error  java.sql.SQLException: Io exception: Got minus one from a read call at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112
java program...need help as soon as possible!!! - Java Beginners
java program...need help as soon as possible!!!  Modify the Lexer (15 points): 1. Use a command line argument for the input file for processing tokens ? do not use simple.x 2. Recognize the new tokens > void float
How sql Queries possible in DAO without creating Database connections - Java Beginners
How sql Queries possible in DAO without creating Database connections  In DAO we are writting sql queries , how it is possible without creating and closing database connections
Surgery to lose weight
on Possible Complications of weight loss surgery (Bariatric Surgery), Weight Loss... is now opting for the weight loss surgery to reduce the weight. Weight loss surgery is also one of the options for the weight loss. Surgery to lose weight
I want to know the all possible syntax for EL code to print the first element of an array.
I want to know the all possible syntax for EL code to print the first element of an array.  Which is the correct EL codes syntax to print the first element of an array named employeeArray. ${employeeArray["0"]} or ${employeeArray
Lose Weight Surgery
Lose Weight Surgery This article discusses about weight loss surgery and how it is useful in reducing weight. These days weight loss surgery is successfully... even after dieting you can find good doctor and go for weight loss surgery
NumberFormatter in Flex4
rounding and precision, thousand separator and negative sign. for example,203.4567=203.456 . You can use the precision property for decimal length. If an error...:NumberFormatter id="numberFormatter" precision="3"
CurrencyValidator in Flex4
CurrencyValidator in Flex4: The CurrencyValidator class validates the currency format. You can set the precision property in it. The Tag...; property="text" precision="2" trigger="{btn
JavaScript toPrecision method
into the number with the number of digits as provided for the precision. Syntax... a number like 123.456 and we have provided the number of digits for precision 7... of digits for precision. We also have created a button "Show Precision Value"
Get Time And Date
Get Time And Date       The Class  Date provides you  a specific instant in time( millisecond) precision. This class enabled you to interprets  allowed 
Fail Early, Fail Often
as soon as possible. You will write a lot of bugs. Just accept it, but make it as easy as possible to find them.. I've known a lot of fanatically capable.... Catch runtime errors early if possible The worst kind of runtime error causes
Extend Text Clock
Java: Example - Extend Text Clock Here are several possible extensions to Example - Text Clock 2. Minor changes. The time should be centered in the field. This can be done by calling the setHorizontalAlignment(JTextField.CENTER
switch Statement - Overview
Java Notes switch Statement - Overview Purpose of switch: select one of many possible statements to execute... on a boolean value (only two possible values). The switch statement allows
Boolean
Java NotesBoolean The primitive type boolean has only two possible values: true and false. Boolean literals - true and false The two values are written with the reserved words true and false. Booleans in control
Why effective fleet management is necessary?
In case you are wondering why effective fleet management is necessary and what will be loss one has to face in case they neglect or give less attention in managing their fleet, than beware the negligence has made man country suffer huge
 

 

 

DMCA.com