Trouble with double

Hi all,
I tried to compile and run this code :
public class TestDouble {
     public static void main(String ar[]) {
          //The total balance
          double balance =19620.9d;
        balance -= 3542.9d;
        //Expecting the balance to be 16078
          System.out.println("Remaining balance : "+balance);
          balance -= 6144.0d;
          //Expecting the balance to be 9934
          System.out.println("Remaining balance : "+balance);
          balance -= 1200.0d;
          //Expecting the balance to be 8734
          System.out.println("Remaining balance : "+balance);
          balance -= 1200.0d;
          //Expecting the balance to be 7534
          System.out.println("Remaining balance : "+balance);
          balance -= 5134.0d;
          //Expecting the balance to be 2400
          System.out.println("Remaining balance : "+balance);
          balance -= 1200.0d;
          //Expecting the balance to be 1200
          System.out.println("Remaining balance : "+balance);
          balance -= 1200.0d;
          //Expecting the balance to be 0
          System.out.println("Remaining balance : "+balance);
          System.out.println("Remaining balance > 0 : "+(balance>0));
}I expect the final balance to be printed as zero.
However this is the out put that I am getting
G:\Ws\Test>javac -version
javac 1.6.0_14
G:\Ws\Test>javac G:\Ws\Test\TestDouble.java
G:\Ws\Test>java -version
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Client VM (build 14.1-b02, mixed mode, sharing)
G:\Ws\Test>java TestDouble
Remaining balance : 16078.000000000002
Remaining balance : 9934.000000000002
Remaining balance : 8734.000000000002
Remaining balance : 7534.000000000002
Remaining balance : 2400.000000000002
Remaining balance : 1200.0000000000018
Remaining balance : 1.8189894035458565E-12
Remaining balance > 0 : trueCan someone help me in understanding what's wrong.
Thanks,
Anil

For accounting, the thought of using rounding is not acceptable. Accounting typical only requires add, substract and multiplied by a quantity. An alternative to BigDecimal is to use long values for the smallest unit. e.g. use cents instead of dollars. The risk of error is important and BigDecimal is likely to be the best choice for this reason.
However in finance or banking, rounding is better understood as it is used, often unavoidable. You will find double is typically used for simplicity (often speed is also given as justification) While double is dramatically faster than BigDecimal, this speed improvement is usually not required IMHO.
Only large amounts of money are likely to have a significant rounding error, however large amounts of money are typically estimates. The problem with double is its limited precision, however money is a limit resource and very rare do you need more than 12 digits of accuracy. (double has 15-16 digits of accuracy) Even the US national debt can be represented to the cent using double, yet this is just an estimate. If you attempted to add up all the amounts involved in the US national debt, it would change while you are doing it.
I worked at a bank where in one dept the unexplained PnL was measuring in "millions of pounds per month" (PnL being Profit and Loss) I can assure you if you has mentioned an error 1.8e-12 dollars it would be given a proportionate amount of consideration, if not amusement.
In summary: There is no realistic, hard amount of money that would get an error using double which could not be handled by appropriate rounding. Any estimate of money is not accurate enough to require more precision than double.
Edited by: Peter__Lawrey on 13-Dec-2009 14:38

Similar Messages

  • Having trouble with double entries in ical after installing Lion.  After entering an event, another one pops up right next to it.

    Having trouble with double entries in ical after installing Lion.  After entering an event, another one pops up right next to it.

    Check iCal preferences, the Accounts Tab. You might have duplicate accounts.

  • Officejet Pro 8600 plus: trouble with double sided printing

    I have just installed Officejet Pro 8600 plus. My iMac is running on OS X 10.9.2
    I want to print a double sided brochure. And I have succeeded. However, the printing on one side of the paper is upside down.
    To achieve this:
    Print <Copies & Pages <Layout - turn on two-sided - long edge binding
    Layout direction is greyed out
    How can I fix this please

    Hello xxzz,
    Welcome to the HP Forums.
    I see that the flip on long edge option is greyed out for you when you try to print double sided. I will try to help you with this.
    Usually if an option is greyed out, it indicates that the software wasn't installed completely or correctly. That or the printer isn't capable of the task. Knowing that this printer is able to duplex, it could be a problem with the software/drivers.
    Try the following.
    Uninstall the software.
    Reset the print system.
    Verify/Repair disk permissions
    Re-install the software - software download
    Test to see if you're now able to choose the options.
    Let me know how things go, thank you for posting on the HP Forums.
    I worked on behalf of HP.

  • Trouble with doubles (adding, setting precision)

    Firstly,
    I have a loop that adds 0.3 three times. For some reason it comes out as .8999999999999!
    Why is this?
    Second, does anyone know where I can download a class or view source code that allows you to set decimal precision of a double? I started writing one myself but it's more complex than I thought and I'd rather just use someone elses if I could...

    The precision of calculations and how numerical
    floating point numbers are handled in computers are is
    very relevant for business situations. Actually the
    problems with decimal numbers themselves often need to
    be understood by those creating the business rules (ie
    like the sales people, audit departements, CEOs, etc.)
    The precision of the java double itself is unlikely to
    ever have an impact on that though.
    For example, if a business person asks you to
    calculate a mortgage payement then they must
    understand exactly the impact that the imprecision of
    such decimal calculations will have on the business.
    And they must understand it enough so that they can
    decide the correct way for handling it. The rules
    for handling this case, at least in the
    mortgage/banking industry, is going to be far less
    the possible precision that a java double can have.
    (The reason of course being that how this is handled
    d impacts the credits of the lender and the debits of
    the lendee.)
    Given the above it matters little what data types are
    used to handle the calculation itself. But rather
    that the calculation is done in such a way that the
    business people understand it and that they understand
    the limitations of it as well.Okay, I don't disagree with any of that. Still not sure about your overall point though.
    * P-L said "don't add doubles in a loop because it compounds rounding errors."
    * I said "but if the number of addtions multiplied by the maximum error is still within your error tolerance, it's okay." In other words, Java's double's precision is not necessarily going to be a problem.
    * You said some things that seem to agree with that final point, but your "that is fine if your job consists of nothing but evaluating computers, but for the rest of us the errors in the data that we are using..." comment makes it sound like you're disagreeing with my point: "The errors in Java's double may not cause you problems. Know it's limitations, and how they relate to your requirements."
    Are you looking for an argument, now that "one exit point" has fizzled? :-) Or am I just being particularly dense today?
    &para;

  • Trouble with double byte swapping routine

    I'm working on a program that reads little endian doubles from a DataInputStream and then swaps them. Usually, everything works fine. However, certain values don't swap correctly.
    I'm at a total loss as to why this is happening, so I hoped one of you guys could show me. I've included a demonstration program with the method I'm using to swap doubles.
    public class SwapTest
         public static void main(String[] args)
              new SwapTest();
         public SwapTest()
              // The swap routine works well with this value
              double d = 0.8660252094218776d;
              System.out.println("d before being swapped: " + d);
              // Swap to small order, then back to big order
              d = swapBytes(d);
              d = swapBytes(d);
              System.out.println("d after being swapped: " + d);
              System.out.println();
              // Everything gets totally hosed with this value
              d = 0.8660252079425844d;
              System.out.println("d before being swapped: " + d);
              // Swap to small order, then back to big order
              d = swapBytes(d);
              d = swapBytes(d);
              System.out.println("d after being swapped: " + d);
         private static double swapBytes(double sm)
              long smallendian = Double.doubleToLongBits(sm);
              long result;
              long l1 = (smallendian & 0x00000000000000FFL) << 56;
              long l2 = (smallendian & 0x000000000000FF00L) << 40;
              long l3 = (smallendian & 0x0000000000FF0000L) << 24;
              long l4 = (smallendian & 0x00000000FF000000L) << 8;
              long l5 = (smallendian & 0x000000FF00000000L) >>> 8;
              long l6 = (smallendian & 0x0000FF0000000000L) >>> 24;
              long l7 = (smallendian & 0x00FF000000000000L) >>> 40;
              long l8 = (smallendian & 0xFF00000000000000L) >>> 56;
              result = l1 | l2 | l3 | l4 | l5 | l6 | l7 | l8;
              return Double.longBitsToDouble(result);
    }

    The doubleToLongBits() method converts invalid values to NAN before converting

  • I am having trouble with my iphoto. I can't print from there or do much of anything. When i double click on an event it doesnt open. Any suggestions?

    I am having trouble with my iphoto. I can't print from there or do much of anything. When i double click on an event it doesnt open. Any suggestions?

    ~/Library/Preferences/com.apple.iPhoto.plist
    ~ = your home folder
    Here's a picture
    Chris

  • Hi i am havin trouble with my ipad after i have downloaded a game and have been playing for a while it seems to of diapeared and the screen goes a white blank background there is nothing on the screen at all so i switch it off and back on and it is white

    hi i am having trouble with games on my ipad as i have been playing them the screen goes white and i can't play the game i go back to the game centre on the ipad and click on the icon for the game and come up to play i push play buton and the screen come up again white so any body had the same problem could they let me no thanks

    Quit the game and restart the iPad.
    To quit the game - Go to the home screen first by tapping the home button. Quit/close open apps by double tapping the home button and the task bar will appear with all of you recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner to close the apps. Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    If that doesn't work try this.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.

  • Trouble with Adobe Bridge CS5.5 for Mac Lion Photo downloader

    Hi, I am having trouble with  CS5.5 Bridge's photdownloader when I am trying to choose a folder location.
    Im using Lion / Mac
    When I try to choose say an external drive or another folder location it will freeze up and stay on "Choose" the button flashes on and off but when i try to click it it will not respond or select the desired file location
    The photodownloader does not respond to any other commands..i have to force quit it..yes i have re-booted..re-started and problem remains..
    The only way i can download photos is by choosing the first file option of the pictures file on my harddrive which is not want I wish to do..i have noticed that this started happening after the Raw update..was wondering if this is affecting Photodownloader..
    any suggestions would be greatly appreciated..thank you

    Thank you, SG, for clarifying which OS's this will work with.
    I agree with Jennie - the beauty of "get photos from camera" is that it takes 2 steps out of the workaround you mention above. Personally, I'm okay living with 6.4.1, as I have an older camera. I won't be happy if one of the push updates re-updates me to 6.5 though. I wouldn't want to redo the reinstallation of the new version. This method will not work for any of my clients or students though - they normally can't comfortably follow the technicality of downgrading, and some have newer cameras and would need the 6.5 version. (I don't believe in betas for my clients, and neither do they, for the most part)
    I guess I should thank Adobe - some of my clients have needed tech support to perform the downgrade (SO many people aren't comfortable technically), and some of my clients needed to be retaught the workaround SG mentions. Adobe's flub has actually made me a little money - which I'd rather not have to make this way.
    SG's workaround does work and makes sense - but for my clients with hundreds of images at a time, who have to rename items, add copyright info, & etc., this more than doubles their work-time for the start of their workflow. I hope Adobe gets that GM version out soon.
    BTW - this issue supports an argument I've hadfor years regarding "PUSH" updates. I always tell my clients and students not to do them until they research the update. Because of what I do, I do have to install them personally, but I'm grateful I'm comfortable fixing things myself.

  • Why can't I open files with double click, etc?

    Hello, all,
    I have been having problems with my MacBook (Aluminum late 2008, I think, OS 10.5). It runs slowly; files on the desktop and in my "Macintosh HD" often won't open with double-click but have to be opened with File-->Open; there are Word Work Files that won't go away; the trackpad is often stiff and not very responsive; clicking on the mouse is very stiff, despite very easy settings. In short, a lot of things are sluggish. Sometimes, also, I get the spinning beach ball, but not all the time.
    I have run disk permissons repair from Disk Utility many times (both from the desktop and from the MacBook install disk); I have replaced the directory with Disk Warrior at least twice; I have verified that the disk is OK; I have zapped the PRAM; and done other things of that kind.
    I took the MacBook to an Apple Store yesterday. It had been unplugged and much to my surprise, most everything seemed to be working all right. When I opened it today, however, I found everything as it was before I took it to Apple. Including the Word Work files, which I thought were gone.
    If I recall correctly, this started when I was working on a long editing project in Word, but I don't know whether that has anything to do with what has happened. I've done similarly long projects before, and this never happened.
    I could try trashing the Word Work files (there seem also to be quite a lot of folders with "recovered" files), but I don't want to do that unless I can be assured that nothing bad will come from doing that.
    I know this seems quite comprehensive, and may involve several issues, but I'm really unhappy about this and would love to think there is something more I can do, apart from returning to the Apple Store. Besides everything else, how can I khow that I won't find, again, that the MacBook will work fine there but goes back to its troubled state when I return?
    Clues, anyone?
    Thanks,
    jenny

    Hi, Mike,
    I have 211.59 left out of total HD space of 232.57.Space should not be a problem. I'll try using Activity  Monitor today. I have 2 GB of memory. But since this is the first time I[ve had this problem, I don't see how it could be a problem with memory, do you?
    I finished the project more than a week ago. After I shut down the computer, it temporarily returned to normal but subsewuently started acting odd again, although I've done nothing but email since I turned it on again.
    I am going to try getting rid of the Word Work files and see whether that helps. I am wondering whether the book I was working on had something wrong with it (it was written in NeoOffice but opened in Word), or my copy of Word has gotten corrupted. Although I haven't used Word since I finished with the book.
    Sorry this font is so tiny, but although I was able to choose my font in my original message, there doesnt' seem to be a place to do that here. At least, I don't see it.
    I'll get back to you on the Activity Monitor. Thanks.
    jenny

  • Trouble with class

    I am unable to figure out what I am having trouble with this, here is the code
    public class Tools3
        protected long item_number;
        protected String product_name;
        protected long units_in_stock;
        protected double price_of_each_unit;
        protected static double total_price_of_inventory;
    public Tools3( long pitem_number, String pproduct_name, long punits_in_stock, double pprice_of_each_unit)
       item_number = pitem_number;
       product_name = pproduct_name;
       units_in_stock = punits_in_stock;
       price_of_each_unit = pprice_of_each_unit;
       total_price_of_inventory = punits_in_stock * pprice_of_each_unit;
    // Overloaded constructor for empty balance
    public Tools3()
       item_number = 0;
    public void set_item_number( long pitem_number )
       item_number = pitem_number;
    public void set_product_name( String pproduct_name )
       product_name = pproduct_name.toString();
    public void set_units_in_stock( long punits_in_stock )
       units_in_stock = punits_in_stock;
    public void set_price_of_each_unit( double pprice_of_each_unit )
       price_of_each_unit = pprice_of_each_unit;
    public long get_item_number()
       return item_number;
    public String get_product_name()
       return product_name;
    public long get_units_in_stock()
       return units_in_stock;
    public double get_price_of_each_unit()
       return price_of_each_unit;
    public double calculate_total_price()
       return units_in_stock * price_of_each_unit;
    public double calculate_total_price_of_inventory(Tools3[] mytools)
       double rettotal = 0;
       for (int i = 0; i < mytools.length; i++)
        rettotal = rettotal + (mytools.get_units_in_stock() * mytools.get_price_of_each_unit());
       return rettotal;
      public void sort_by_names(Tools3[] mytools)
      int a,b;
      int sortTheStrings = mytools.length - 1;
      String tempproduct_name;
      long tempitem_number;
      long tempunits_in_stock;
      double tempprice_of_each_unit;
        //need to implement a bubble sort here
        for (a = 0; a < sortTheStrings; ++a)
      for (b = 0; b < sortTheStrings; ++b)
      if(mytools.product_name.compareTo(mytools[b + 1].product_name) >0)
        //move name
        tempproduct_name = mytools.product_name;
        mytools.product_name = mytools[b+1].product_name;
        mytools[b+1].product_name = tempproduct_name;
        //move item_number
        tempitem_number = mytools.item_number;
        mytools.item_number = mytools[b+1].item_number;
        mytools[b+1].item_number = tempitem_number;
        //move units_in_stock
        tempunits_in_stock = mytools.units_in_stock;
        mytools.units_in_stock = mytools[b+1].units_in_stock;
        mytools[b+1].units_in_stock = tempunits_in_stock;
        //move price_of_each_unit
        tempprice_of_each_unit = mytools.price_of_each_unit;
        mytools.price_of_each_unit = mytools[b+1].price_of_each_unit;
        mytools[b+1].price_of_each_unit = tempprice_of_each_unit;
    //end of tools3.java class

    Results from javac
    C:\Java>javac Tools3.java
    Tools3.java:77: cannot find symbol
    symbol  : method get_units_in_stock()
    location: class Tools3[]
        rettotal = rettotal + (mytools.get_units_in_stock() * mytools.get_price_of_e
    ach_unit());
                                      ^
    Tools3.java:77: cannot find symbol
    symbol  : method get_price_of_each_unit()
    location: class Tools3[]
        rettotal = rettotal + (mytools.get_units_in_stock() * mytools.get_price_of_e
    ach_unit());
                                                                     ^
    Tools3.java:94: cannot find symbol
    symbol  : variable product_name
    location: class Tools3[]
      if(mytools.product_name.compareTo(mytools[b + 1].product_name) >0)
                ^
    Tools3.java:97: cannot find symbol
    symbol  : variable product_name
    location: class Tools3[]
        tempproduct_name = mytools.product_name;
                                  ^
    Tools3.java:98: cannot find symbol
    symbol  : variable product_name
    location: class Tools3[]
        mytools.product_name = mytools[b+1].product_name;
               ^
    Tools3.java:101: cannot find symbol
    symbol  : variable item_number
    location: class Tools3[]
        tempitem_number = mytools.item_number;
                                 ^
    Tools3.java:102: cannot find symbol
    symbol  : variable item_number
    location: class Tools3[]
        mytools.item_number = mytools[b+1].item_number;
               ^
    Tools3.java:105: cannot find symbol
    symbol  : variable units_in_stock
    location: class Tools3[]
        tempunits_in_stock = mytools.units_in_stock;
                                    ^
    Tools3.java:106: cannot find symbol
    symbol  : variable units_in_stock
    location: class Tools3[]
        mytools.units_in_stock = mytools[b+1].units_in_stock;
               ^
    Tools3.java:109: cannot find symbol
    symbol  : variable price_of_each_unit
    location: class Tools3[]
        tempprice_of_each_unit = mytools.price_of_each_unit;
                                        ^
    Tools3.java:110: cannot find symbol
    symbol  : variable price_of_each_unit
    location: class Tools3[]
        mytools.price_of_each_unit = mytools[b+1].price_of_each_unit;
               ^
    11 errors

  • Updated iphone 5 to iOS 6.1.3, now trouble with keyboard not responding correctly and screen zooming in by itself...

    updated iphone 5 to iOS 6.1.3, now I am having trouble with keyboard not responding correctly and screen zooming in by itself...
    Buttons pressing themself...
    Also, my main screen is permanently zoomed in...
    suggestions?

    Double tap the screen with THREE fingers, that should get it back to normal again.
    Then go into Settings > General > Accessibility > Zoom > OFF.
    Not too sure about the keyboard and random button presses though.  Back it up and restore from iTunes, see if that fixes it.

  • Trouble with UTF-8 and PHP-OCI

    Hi there!
    I'm having some serious trouble with UTF-8. I just tried to insert a lambda into an NCLOB column in one of my databases and it was converted to an inverted question mark. I have verified that the string reaches my PHP script correctly encoded. Also selecting RAWTOHEX(column) in SQL Developer shows, that the inverted question mark is already stored in the column. So the problem must be somewhere between PHP-OCI and the database. Inserting a lambda via SQL developer works. I can also correctly fetch it via PHP.
    I'm using the latest PHP-OCI (2.0.8). v$version says "Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production".
    The database is fairly old and uses WE8MSWIN1252 as the character set and AL16UTF16 as the NCHAR character set. Hence I'm using NCLOB instead of CLOB. However, I connect to the database with AL32UTF8, since my app is running in UTF-8. I was under the impression that this would result in an automatic conversion from UTF-8 to UTF-16 when inserting into NCLOB columns, but apperently this is not the case. It looks like there is some sort of double conversion, first UTF-8 to WE8MSWIN1252 and then to UTF-16, because some non-ASCII characters like ä (a umlaut) get correctly converted from UTF-8 to UTF-16.
    Any ideas? I'm at a loss here. Thanks in advance.

    PHP OCI8 doesn't support NCLOB or NVARCHAR2.
    See NCLOB support in OCI8

  • 8.1.7 jdbc driver: object types with double quotes

    Hi all,
    While switching from 8.1.6 to 8.1.7 I have trouble with the jdbc driver. It doesn't work
    as before: The function CallableStatement.registerOutParameter (and probably some other) doesn't take object type
    names in double quotes anymore. A test program is appended to this message. Using a 8.1.6 jdbc driver this program works fine but with a 8.1.7 jdbc driver it throws an exception.
    My questions are: Is this bug already filed?
    Is a bugfix already available somewhere?
    Thanks in advance for any information
    Joerg
    import java.sql.*;
    * create type "test_t" as object (atrb number(10));
    * create table "test" of "test_t" (atrb not null) oidindex();
    class test
    public static void main (String args [])
    throws SQLException
    String s = "begin insert into \"test\" t values (1)" +
    " returning ref(t) into ?; end;";
    try{
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@host:1521:orcl","joerg", "password");
    CallableStatement cs = conn.prepareCall( s );
    cs.registerOutParameter(1, Types.REF, "\"test_t\"");
    cs.execute();
    System.out.println("Statement returned:");
    System.out.println( cs.getObject(1) );
    cs.close();
    conn.commit();
    conn.close();
    catch(SQLException e){
    System.out.println("SQLException was thrown...");
    System.out.println(e.getMessage());
    }

    I believe that typenames are always treated as case sensitive (unless they are all uppercased).
    In your example you should write:
    cs.registerOutParameter(1, Types.REF, "test_t");
    If you had declared the type test_t in a case insensitive way (without "..."), then you'd have to write:
    cs.registerOutParameter(1, Types.REF, "TEST_T");
    If you have a schema-qualified name, use a ".":
    cs.registerOutParameter(1, Types.REF, "SCOTT.test_t");
    However, this behavior implies that you cannot use "." inside of quoted identifier names.

  • Has anyone had trouble with the middle mouse (open in new tab) button lately?

    Hi gang. Since v29 came out, I have been having trouble with the middle mouse (open in new tab) button.
    Sometimes the button does not register with Firefox. And sometimes FF acts like I pressed it several times.
    Has anyone else had any problems? I use an add-on called
    '''''[https://addons.mozilla.org/en-US/firefox/addon/mclickfocustab/?src=collection&collection_id=33bf10fa-666d-45a2-9bc9-491ce21671c6 MClickFocusTab]'''''
    I disabled it but the problem was still there.

    ''''' "Sometimes the button does not register with Firefox. And sometimes FF acts like I pressed it several times." '''''
    Sounds like a mouse on its' way to mouse-heaven. Seriously, the exact symptoms I have seen with a dozen 3 button mouse's (?meese - ?mice) over the last 15 years. <br />
    Not registering a click is usually due to a dirty contact. And the "double-click" is when the flat spring looses tension and bounces.
    I have had similar happen with the left button, too. But when it happens to that button it is more noticeable much sooner.
    I bought a box of a dozen A4D house branded infrared wireless 3-button mouse's for like $24.00 back in 2000 that were on clearance because the driver disk didn't support W2K, only Win95, 98, and NT4. I got newer drivers from the A4D website and wore all 12 out over the 8 or 9 years. I even fixed a few that broke from the parts from other broken mouse's. I still have 6 or 7 of them laying in the "needs to be fixed" box under my workbench. I'll probably never fix them though, the nano receiver USB mouses I have been using for the 4 or 5 years have much better battery life and lately only need one AA battery.

  • I am having trouble with sound on my iPad

    I am having trouble with sound on my iPad

    Found the fix.
    If the reboot doesn't fix it.
    If the headphoens work find, but no external speakers.
    If the double-click and page right to the software mute, doesn't show the sound knob - just the brightness
    If your pop-up shows "Docking Station"
    Then, the problem is very likely a dirty connector.  The iPad/iPhone/iPod connector uses a resistor value to determine if the device is connected to an external 'speaker'.  There are a range of resistances, for a range of products.  This is known as the Connector Pin 21 issue.
    Take some windex on a que-tip, or perhaps a Windex paper scrub and rub it on the bottom connector port.  Somehow, "something" has gotten on those contacts, and it is pulling the voltage on pin #21 down - so that the iPad "thinks" it's connected to an external speaker - this will disable the internal speaker circuitry, as well as the internal speaker volume controls.
    Do not over-saturate and short out your iPad.  Do not throw it in the sink, do not use the kitchen faucet to flush it out.  A Que-tip with a few drops of Windex (or other gentle cleaner) should work just fine.  Takes all of 30 seconds - and magically, the volume knob appeared and everything worked just fine.

Maybe you are looking for

  • What happened to the type tool in Photoshop CS5?

    In previous versions of Photoshop, when the type tool hovered over text I could edit, it switched to just the up and down type cursor tool...and when it was over a region where I could click to create a new text layer, the cursor would show up with a

  • Cannot access some sites in either Firefox or Safari

    I'm not sure when this began, but last month I tried to go to Ebay in both Safari and and Firefox and neither would find the site. Here's what I'm using: MacPro Desktop 2 x 2.8GHz, Quad-core Intel Xeon 8GB memory Snow Leopard 10.6.8 My network is set

  • Help with iTunes/iOS Album Sort

    We all know the Music.app since iOS 7 (for most of us) as been a disaster. Due to the expanded view of the albums for artist, it's a PITA for people whom have artist with even 3 or 4 plus albums. For me, I love E-40 and have 16 of his albums. My conc

  • Email -Save as- New Folder- buggy -no copy/paste

    Email -Save as- New Folder- buggy. I can't paste text into a new folder field whether from a file/save as path or save attachments as- new folder.  That new folder dialog box does not allow copy or paste, only direct typing.   I've tried on three mac

  • Passing Call values to a linked Request created by IPK Workflow

    I know how to transfer a Call values to a linked Request when creating it manually from a Call screen. But (how) is it possible to specify Call fields which values should be submitted to a Request when it is created automatically by IPK Workflow Rule