Using very long/large numbers

Hi, I want to know how to "store" and use very large numbers.
For example, say I had:
double n = 1.23456789101112131415;
or:
double n = 123456789101112131415
I know that they are too big for using double, so how would I be able to store it; and even more importantly round it ,preferably using "Math.round," to 15 decimal places?
i.e. tell it to do this:
n = 1.23456789101112131415;
number = Math.round((1000000000000 * n) / 1000000000000 .0);
System.out.println(number);

As much as your "advice" helps, the java docs provide
only methods for the BigDecimal/Integer
objects. They don't show complete syntax, and don't
contain examples. Fortunately, I have avoided the
"35-years-old-and-still-living-in-my-mother's-basement
-and-aren't-even-professional-programmers" path and
have enough of a life that I try not to spend all day
reading about Java syntax.I don't believe this. Morgalr gave you genuine help. You spent more time criticizing him than conducting a very simple google search sucha as "BigInteger"+"example". I would suggest a little attitude adjustment if you still want people to help you next time.

Similar Messages

  • I want to *use* very long file and path names!

    This is really a plea to Microsoft...
    There are several threads about copying or deleting files where the path and/or file name is too long.
    Most have explanations of why this problem occurs.  (depending on Windows version and application, the total length [fully qualified file name; i.e. C:\this-dir\that-dir\somefile.xyz] is limited to a maximum of 260 or fewer characters).  This limit
    But I *WANT* to be able to use very long file names and paths!
    I can understand Microsoft keeping this limit - even while allowing UNICODE paths and file names up to 32k characters - because many existing tools will be unable to handle the longer names.  This would probably yield a lot of questions/flames about
    them "breaking the software I've used for years."
    But it would be possible to have a system setting to optionally allow the long names.  Since I'd have to manually set it, I'd know I'm potentially breaking existing software.
    In my case, I'm backing up various file directories where some files are very long.  With the server-side additional paths (e.g., client-name\project-name\backup-date\...") I occasionally hit files that can't be copied.  Renaming is not suitable;
    sometimes names have to match other file names.
    I can zip them, create iso files, use a backup program that creates a blob, put them in a source-control system, etc - but I really don't *want* to do that; it's very convenient to have a direct copy of the directories.  Each of these 'solutions' either
    requires extra work (which could be scripted, so ok...) or doesn't work with the work-flow for some reason.
    Microsoft, *please* fix this in Windows 8!  (if not before...)   This limit has existed for far too long!
    And readers - please don't just repeat what's in the other threads (rename/use subst/map directory/etc) or flame without useful information.  Thanks!

    Hi,
    I would submit your opinion to our Product Team. If you have another feedback, please feel free and let me know. Or you could follow TekDozer’s advice to submit
    by yourself.
    Thank you for your understanding and cooperation.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

  • Managing large numbers of SPAx102s

    What are service providers using to manage large numbers of 2102s or 3102s?  How are firmware versions controlled and rolled out?  What about configuration & password management?
    Thanks!
    Solved!
    Go to Solution.

    Hello,
    as called "provisioning" is used for this. The SPA-xxxx devices has ability to remote download (http and tftp) the settings file on regular basis, check for changes, deploy the settings file and reboot. The file is loaded based on device's MAC address, so every device will realy load only it's own file.
    Provisioning can set the adapter password, and can also fil-in rule for the FW update when needed ... and SP-xxxx adapter will check FW's file header and if newer (or better different) than the one running in adapter it will download the FW, flash the FW on idle time and then reboot.

  • I have an old ipod that i have not used in a very long time, ive had it on a charger now for over an hour and i still cnnot get my ipod to turn on, how can i fix my problem, i just downloaded the new version of itunes aswell, so i know its not my itunes.

    i have an old ipod touch that i have not used in a very long time, and im having trouble gettign it to turn on. ive had it on a charger for over an hour now and still nothing hs changed. i just updated my itunes to the current version they haev so i know its not an itunes problem its rather a problem with the old ipod touch itself. im leaving for deployment soon and im trying to get this fixed without having to send it in. If anyone has any ideas on how to get this thing turned on it would be greatly appreciated.

    Well, two thoughts.
    The battery has completely discharged and will take overnight to recharge, so don't expect much in an hour.
    The battery has deep discharged and is now dead. It will never recharge and should be replaced.
    If your iPod Touch, iPhone, or iPad is Broken
    Apple does not fix iDevices. Instead they exchange yours for a refurbished or new replacement depending upon the age of your device and refurbished inventories. On rare occasions when there are no longer refurbished units for your older model, they may replace it with the next newer model.
    You may take your device to an Apple retailer for help or you may call Customer Service and arrange to send your device to Apple:
    Apple Store Customer Service at 1-800-676-2775 or visit online Help for more information.
    To contact product and tech support: Contacting Apple for support and service - this includes international calling numbers.
    iPod Service Support and Costs
    iPhone Service Support and Costs
    iPad Service Support and Costs
    There are third-party firms that do repairs on iDevices, and there are places where you can order parts to DIY if you feel up to the task. Start with Google to search for these.
    The flat fee for a battery exchange is, I believe, $99.00 USD.

  • HT2506 I use Preview to edit photos, and would like to know if there are any Preview updates in the works. I find there is a problem with Preview crashing, or taking a very long time to "catch up" (spinning beachball of death) while I'm editing.

    I use Preview to edit photos, and would like to know if there are any updates to this program in the works. It seems Apple is constantly updating its software, except for Preview. I find it crashes all too often, and also takes forever to "catch up" with me (as in spinning beachball of death) when I'm editing a lrge amount of photos. Yes, I know I should be using Photoshop or somesuch, but it's just too **** confusing, and I don't have the time to figure it out. Thanks!!

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Enter the name of the crashed application or process in the Filter text field. Select the messages from the time of the last crash, if any. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V).
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    In the Console window, look under User Diagnostic Reports for crash reports related to the crashed process. The report name starts with the name of the process, and ends with ".crash". Select the most recent report and post the entire contents — again, the text, not a screenshot. In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.) Please don’t post shutdownStall, spin, or hang logs — they're very long and not helpful.

  • Is there any way to connect time capsule to a MacBook Pro directly via USB. I have a large amount of data that I want to back up and it is taking a very long time (35GB is taking 3 hrs, I have 2TB if files in total)...)?

    Perhaps via USB. I have a large amount of data that I want to back up and it is taking a very long time (35GB is taking 3 hrs, I have 2TB if files in total)...? I want to use TimeCapsule as back-up for an archive which is curently stored on a 2 TB WESC HD. 

    No, you cannot backup via direct usb connection..
    But gigabit ethernet is much faster anyway.. are you connected directly by ethernet?
    Is the drive you are backing up from plugged into the TC? That will slow it down something chronic.. plug that drive in by its fastest connection method.. WESC sorry I have no idea. If ethernet use that.. otherwise USB direct to the computer.. always think what way the files come and go.. but since you are copying from the computer everything has to go that way.. it makes things slower if they go over the same cable.. if you catch the drift.

  • Very Large Numbers Question

    I am a student with a question about how Java handles very large numbers. Regarding this from our teacher: "...the program produces values that
    are larger than Java can represent and the obvious way to test their size does not
    work. That means that a test that uses >= rather than < won?t work properly, and you
    will have to devise something else..." I am wondering about the semantics of that statement.
    Does Java "know" the number in order to use it in other types of mathematical expressions, or does Java "see" the value only as gibberish?
    I am waiting on a response from the teacher on whether we are allowed to use BigInteger and the like, BTW. As the given program stands, double is used. Thanks for any help understanding this issue!

    You're gonna love this one...
    package forums;
    class IntegerOverflowTesterator
      public static void main(String[] args) {
        int i = Integer.MAX_VALUE -1;
        while (i>0) {
          System.out.println("DEBUG: i="+i);
          i++;
    }You also need to handle the negative case... and that get's nasty real fast... A positive plus/times a positive may overflow, but so might a negative plus a negative.
    This is decent summary of the underlying problem http://mindprod.com/jgloss/gotchas.html#OVERFLOW.
    The POSIX specification also worth reading regarding floating point arithmetic standards... Start here http://en.wikipedia.org/wiki/POSIX I guess... and I suppose the JLS might be worth a look to http://java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html

  • Since itunes and apple tvs latest update I have had problem wtching movies on apple tv via my itunes can any one help, movie takes a very long time to load sometimes never, it use to work really well, whats going on please help?

    Since itunes and apple tvs latest update I have had problem wtching movies on apple tv via my itunes can any one help, movie takes a very long time to load sometimes never, it use to work really well, whats going on please help?

    You might find useful information in item D1 of Time Machine Troubleshooting.

  • I am trying to use two very long (2.5 hour HD) clips in multicam but FCPX only places one clip right after the other and does not create multicam. Is there a limit on clip size for multicam?

    I am trying to use two very long (2.5 hour HD clips) and a 2.5 hour audio clip in multicam. One clip and the audio will ceate a multiclip but two clips will not. FCPX simply adds the second clip on at the end of the first. There must be some sort oflimitation on clip length. Is that correct and if so what is it?

    The Angle field is not shown in the Inspector's default Basic View. With the clip selected in the event viewer, select the Info tab in the inspector. Change the view of the inspector from the default Basic View to the General View to be able to see the Angle field.
    I assume you want to use the audio to do the sync. If FCP X has trouble syncing the audio, you can set a marker at the same chronological point in each clip before creating the multiclip. Then set Angle Syncronization to First Marker on the Angle and keep Use audio for syncronization checked. Your marker only needs to be close to get FCP X started. It will then use the audio to get final sync.

  • My os x mavericks got crashed accidentely while installing the windows 8 and I am trying to reinstall using recovery console, but its take very long time and forcing me to download OS X 8 from internet, is there any where can I get offline download of OS.

    My os x mavericks got crashed accidentely while installing the windows 8 and I am trying to reinstall using recovery console, but its take very long time and forcing me to download OS X mountain lion from internet, is there any where can I get offline download of OS file where I can install directely OS X Mavericks.

    Hi, original poster here. I did not realize this would generate more discussion so I never checked back. I still had my warranty, so I took it to the store and got it repaired. The original problem I had was a screen with this icon flashing when I attempted to boot it up:
    When I took it to the store, they told me that my computer was unable to communicate with the hard drive. I had this same problem three times in two months where this screen reappeared. Each time I went back to the store and they said the cause was different, but they were all hardware issues that physically made it impossible to communicate with the hard drive. After the third time, they simply replaced my laptop and I haven't had the same problem.
    So in short: The reason you can't reinstall or move anything when you encounter this screen appears to be because nothing can communicate with the hard drive in the first place. You can't reach the disk or anything on it. So I don't believe it's possible to do anything besides take it to a physical store and have it fixed.

  • Store Very Large Numbers

    Hello,
    I am trying to find some info about how to store very large numbers with like 2000 digits or even more and do calculations on them.
    Does anyone have any info or links about this ??
    Thanks.

    BigDecimal?Speaking. What can I do for you?
    :)

  • I am now using the free 1 month CC trial. I got a free one year licence with a camera. I have a product key 24 characters long with numbers and letters. I can't find anywhere to put this key to activate the account? Using a PC, windows 8.

    I am now using the free 1 month CC trial. I got a free one year licence with a camera. I have a product key 24 characters long with numbers and letters. I can't find anywhere to put this key to activate the account? Using a PC, windows 8.

    Redemption Code Help
    Mylenium

  • My debit card kept getting rejected by my iTunes account, it there an issue with iTunes? I have been using the same Card since very long time. I downloaded the iOS 8, can I talk to someone so I can get this resolve?

    My debit card kept getting rejected by my iTunes account, it there an issue with iTunes? I have been using the same Card since very long time. I downloaded the iOS 8, can I talk to someone so I can get this resolve?

    Apple is not here. Contact Apple to resolve your issue:
    iTunes Support WorldWide
    or
    iTunes Support by eMail ww
    Cheers,
    GB

  • After installing Lion my time machine using a Time capsule backups take a very long time, particularly indexing the back up, does any one know why and a fix?

    I have installed Lion over Snow Leopard and noticed a marked increase in the time it takes my time capsule/time machine to back up.  It seems to spend a very long time indexing the back up.  Does any one know why and more importantly is there a "fix"?

    The first index with Lion takes a very long time.  Could take over 10 hours.  You just have to wait.  You can see the progress by opening Console and entering backupd in the search box

  • Business Partner records with large numbers of addresses -- Move-in issue

    Friends,
    Our recent CCS implementation (ECC6.0ehp3 & CRM2007) included the creation of some Business Partner records with large numbers of addresses.  Most of these are associated with housing authorities, large developers and large apartment complex owners.  Some of the Business Partners have over 1000 address records and one particular BP has over 6000 addresses that were migrated from our Legacy System.  We are experiencing very long run times to try to execute move in's and move out's due to the system reading the volume of addresses attached to the Business Partner.  In many cases, the system simply times out before it can execute the transaction.  SAP's suggestion is that we run a BAPI to cleanse the addresses and also to implement a BADI to prevent the creation of excess addresses. 
    Two questions surrounding the implementation of this code.  Will the BAPI to cleanse the addresses, wipe out all address records except for the standard address?  That presents an issue to ensure that the standard address on the BP record is the correct address that we will have identified as the proper mailing address.  Second question is around the BADI to prevent the creation of excess addresses.  It looks like this BADI is going to prevent the move in address from updating the standard address on the BP record which in the vast majority of cases is exactly what we would want. 
    Does anyone have any experience with this situation of excess BP addresses and how did you handle the manipulation and cleansing of the data and how do you maintain it going forward?
    Our solution is ECC6.0Ehp3 with CRM2007...latest patch level
    Specifically, SAP suggested we apply/review these notes:
    Note 1249787 - Performance problem during move-in with huge addresses
    **applied this ....did not help
    Note 861528 - Performance in move-in for partner w/ large no of addresses
    **older ISU4.7 note
    Directly from our SAP message:
    use the function module
    BAPI_BUPA_ADDRESS_REMOVE or run BAPI_ISUPARTNER_CHANGE to delete
    unnecessary business partner addresses.
    Use BAdI ISU_MOVEIN_CUSTOMIZE to avoid the creation of unnecessary
    business partner addresses (cf. note 706686) in the future for that
    business partner.
    Note 706686 - Move-in: Avoid unnecessary business partner addresses
    Does anyone have any suggestions and have you used above notes/FMs to resolve something like this?
    Thanks,
    Nick

    Nick:
    One thing to understand is that the badi and bapi are just the tools or mechanisms that will enable you to fix this situation.  You or your development team will need to define the rules under which these tools are used.  Lets take them one at a time.
    BAPI - the bapi for business partner address maintenance.  It would seem that you need to create a program which first read the partners and the addresses assigned to them and then compares these addresses to each other to find duplicate addresses.  These duplicates then can be removed provided they are not used elsewhere in the system (i.e. contract account).
    BADI - the badi for business partner address maintenance.  Here you would need to identify the particular scenarios where addresses should not be copied.  I would expect that most move-ins would meet the criteria of adding the address and changing the standard address.  But for some, i.e. landlords or housing complexes, you might not add an address because it already exists for the business partner, and you might not change the standard address because those accounts do not fall under that scenario.  This will take some thinking and design to ensure that the address add/change functions are executed under the right circumstances.
    regards,
    bill.

Maybe you are looking for

  • Photo Elements Features / Integration

    I really like BOTH PSE 8 and LR 3.    I just spent and lot of time in PSE organizing several years worth of images prior to discovering LR.  Now that I'm trying the LR3 Beta, here are some thoughts: Bring over into LR3 from PSE: Integration/sharing o

  • Unable to open TM -- Error Code -43

    Have been using TM 1.0 for 3 days, suddenly unable to open app. Getting msg "The operation could not be completed. An unexpected error occurred (error code -43)." Re-installed OSX to 10.5.1 and ran "repair disk permissions" from Disk Utility. Any ide

  • Replication from DS 4.1 to DS 5

    Hi, We have 5 Directory Servers 4.1x (Solaris) with a single master replication mode. We don't want to migrate our DS in the immediate future. I want to install a new DS on a Linux server. I don't know where I may download DS 4.1x for Linux, so I'll

  • Limit errors while working with multiple connections

    I'm currently evaluating SQL Developer and I'm looking particularly for functionnalities that permit to distinct clearly several connections, so as to avoid DBA errors when working with several connections in parallel. Currently it seems that SQL Dev

  • Installing and Running WorkBench 1.2.2.2.0

    I am installing Workbench with Sql Server 6.5 plugin on an NT Workstation SP5 that has Oracle 8.05 Client, Enterprise Mgr, and Tuning Pack on it. Right now I have separate Oracle Homes for the Tuning Pack and Oracle Ent Mgr. To install Workbench, I h