How do you calculate a (base * power) sans math.pow?

I've been tasked with trying to figure out how to do an exponent question without using the math.pow(3,2) method. How would I do that?

Yeah it's a non negative number but I don't
understand how a loop would complete this.Say you want to find the value of 10^5, you just do:
int product = 1;
product *= 10; // this is the same as product = product  * 10
product *= 10;
product *= 10;
product *= 10;
product *= 10; Use a for statement for this:
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/for.html

Similar Messages

  • How do you import data base dmp file in oracle 10g

    How do you run data base dmp file in oracle 10g

    Examples..
    Table Exports/Imports
    The TABLES parameter is used to specify the tables that are to be exported. The following is an example of the table export and import syntax:
    expdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log
    impdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=impdpEMP_DEPT.log
    For example output files see expdpEMP_DEPT.log and impdpEMP_DEPT.log.
    The TABLE_EXISTS_ACTION=APPEND parameter allows data to be imported into existing tables.
    Schema Exports/Imports
    The OWNER parameter of exp has been replaced by the SCHEMAS parameter which is used to specify the schemas to be exported. The following is an example of the schema export and import syntax:
    expdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log
    impdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=impdpSCOTT.log
    For example output files see expdpSCOTT.log and impdpSCOTT.log.
    Database Exports/Imports
    The FULL parameter indicates that a complete database export is required. The following is an example of the full database export and import syntax:
    expdp system/password@db10g full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=expdpDB10G.log
    impdp system/password@db10g full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=impdpDB10G.log

  • I wanted to know how do you calculate the number of days between two dates

    i wanted to know how do you calculate the number of days between two dates in java ? i get both the dates from the database. i guess there are many issues like leap year and Febuary having diff no of months ..etc.

    thanks..
    I solve my problem as
    public class MyExample {
        public static void main(String a[]) {
            String stdate = "2009-03-01";
            java.sql.Date currentDate = new java.sql.Date(System.currentTimeMillis());
            java.sql.Date preDate = java.sql.Date.valueOf(stdate);
            System.out.println(currentDate);
            System.out.println(preDate);
    //        int dateCom = preDate.compareTo(currentDate);
    //        System.out.println(dateCom);
            long diff = currentDate.getTime() - preDate.getTime();
            int days = (int) Math.floor(diff / (24 * 60 * 60 * 1000));
             System.out.println(days);
    }

  • How do you calculater correlation coefficients for data?

    I would like to calculate the correlation coefficient for data which has a linear correlation. I can calculate the linear fit, but how do you calculate the correlation coefficient from this data. Any help would be greatly appreciated.

    If you're just looking for the correlation coefficient (r^2 or r) of a linear regression, you can use the method described HERE earlier.
    LabVIEW Champion . Do more with less code and in less time .

  • How do you calculate the count in before a cue start?

    Here's what I can't figure out.
    I have a quicktime loaded and I need to start a cue at, let's say, 1:05:07:10. I want the tempo to be, oh, 120. I arbitrarily say - this will be measure 41 but it doesn't really matter, I just need my downbeat at that TC and the tempo to be correct.
    So far so good. I have no problem doing this with Tempo operations. I lock the time code, assign it a measure (in this case 41) and have logic calculate a single tempo from 1:00:00:00 (measure 1) to the desired start.
    Now here's my real question. How do I calculate 4 or 8 beats before 1:05:07:10 so I can have a count it at the correct tempo (120)?
    So I'm wonder how some of y'all handle this situation.
    Thanks

    As long as you are in the Fetch call, all other calls to the Scope
    driver will block until Fetch exits.  That's why the Abort doesn't
    do anything.  You have two options:
      1) Use a finite timeout.  Obviously, you are running into
    cases in which the trigger does not arrive, and want to exit
    cleanly.  This is exactly what the timeout is for.
      2) Determine the acquisition state before calling fetch. 
    If this is a finite, single-record acquisition, poll on acquisition
    status and do not call fetch until the status is 1 (acquisition
    complete).  If you're doing a finite, multi-record acquisition,
    poll on the Fetch>>Records Done property and only fetch the
    records that have completed.  If you're doing a continuous
    acquisition, poll on the Fetch>>Points Done or Fetch>>Fetch
    Backlog property and only fetch the number of points that have been
    acquired.
    There's no clean way to break the infinite timeout fetch without forcing LabVIEW to close.

  • How do you calculate accumulated displacement?

    Hello! I would like to calculate the amount of displacment accumulated during a laboratory test using LVDT positions. Acquiring the signal and determining the position is no problem. However, I cannot think of an efficient way to sum the displacement measured by the LVDTs during the test period. From a progamming standpoint, I would simply save an initial value and subtract the current loop value to obtain the displacement. In the attached example I use a method which uses a case structure and a shift register, but it seems a bit brute force. Do you know of a more elegant way of doing this? If not, how do I tidy it up?
    Attachments:
    LVDT_displacement.vi ‏145 KB
    LVDT_DAQ_Assistant.PNG ‏22 KB

    Evan,
    Create control will create arrays on Add or Multiply only if an array is wired to one of the other terminals. Did you have the array from DDT wired to the Multiply (without the Index Array) when you first created the slope and intercept controls?  If you do not want arrays, go to the front panel, delete the array controls, and drop scalar controls on their places. Then wire the terminals to the numeric functions on the block diagram. Everything should then be scalars.
    It looks like the DAQ Assistant is set to acquire data from two channels at 1000 samples per second and to retrieve 100 samples on each call.
    When you convert from DDT to 1D array of DBL you get only one of the two channels. The array should contain 100 points from the first channel. All of the data from the second channel is lost. You then index out the first and second elements of the array from the first channel.
    I doubt that this is what you really wanted to do.
    The DAQmx VIs will give your direct control over the datatypes and eliminate the extra overhead of the DAQ Assistant.
    You should be able to configure the From DDT to allow you to select the channels. Double click to bring up the configuration dialog. You can select 2D array of scalars and then use Index Array to get the channel you want. Another option is to use 2 copies of From DDT and select 1D array of scalars - single channel. Then choose the channel with the control below the Scalar Data Type box.
    Once you get the arrays configured correctly I suggest that you calculate the Mean of each array and use that for your single value per iteration. Averaging the 100 points should significnatly reduce any noise on the signal.
    Lynn

  • How do you create data base documents in Pages '09?

    Can you create Data Base documents with Pages, or any of the iWork Apps?

    If you want to create and use true databases, you must use an other app dedicated to this feature.
    There is a powerful database tool in LibreOffice but it requires a serious learn curve.
    There are numerous available apps starting from Bentoy to FileMaker or 4th Dimension.
    Matter of needs and finances.
    Yvan KOENIG (VALLAURIS, France)  dimanche 11 décembre 2011 10:54:27
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • How do you calculate a field

    Hi all,
    I would really appreciate some help as I do not know programing, java script or other programming languages.  I need to have a field calculate for me.
    The form has date of birth. Then I need the next field, (a text field) calculate the age on the previous field of the Date of Birth.  Does anyone have an idea how to do that?  I have gone through the help guide, but it assume you know the langauage to put in.
    thanks in advance.

    Janet, I've fixed the form and attached the updated version.  There were a couple of things that I changed:
    1. The form was saved as a static .pdf form.  This means that it's for display only; you can't run any scripts and change things programatically.  I changed it to be a dynamic form, which allows scripts to run when the user is entering data.  To do this I selected Save As from the file menu and then selected Save as type: Adobe Dynamic XML Form (*.pdf).
    2. Since the form was saved as static it stripped out the scripts.  I re-pasted the script that I gave you back into the calculate event for the Age field.
    I also changed the Language dropdown on the upper right side of the script window to Javascript, since that's the language that I used.
    3. The name of your DOB field is DateTimeField1.  You can see this by either looking at the Hierarchy window or by looking at the Field tab of the Object window.  In the future you should change the names of the fields from their default to something more descriptive.  For now it's fine.  I then replaced my references to "DOB" in my script with "DateTimeField1.
    4. Make sure that the preview type is set to dynamic.  Go to the File menu in designer and select the Form Properties item.  Click on the Preview tab and choose "Preview Type": Interactive Form and "Preview Adobe XML Form as": Dynamic XML form.
    The above changes made it work, but I changed one more thing:  The type of the DOB field is set to DateTime field, and when you use the pop-up calendar to select the date it gets saved in the data in a backward format (YYY-MM-DD).  This doesn't show up on the form since you have the display format set, but behind the scenes it messes up the date calculation in the script.  I set the edit pattern for the field to be either D/M/YYYY or D-M-YYYY to allow some flexibility when the user enters the date, and to force it to save in the proper format for the script.
    Oh, forgot to mention that "new Date()" gets the current date from the system, so you don't need a field on your form for it.  Green is a comment, not part of the script but just to document what's happening in the script.  Blue means reserved script instruction, black is everything else.  Makes more sense to you if you're a programmer. The Livecycle editor automatically colors the text to make it easier to read, we just type it in.
    Give this a try and let me know if you have more issues.
    Kevin

  • How do you calculate the instantane​ous frequency of a signal in LabView?

    I'm working with neural signals that can be described as a nonlinear series of action potentials.  I've already calculated the spike density function (spikes per second against time) and was wondering if this is the instantaneous frequency?  If not, could someone please describe how to calculate instantaneous frequency in LabView without the advanced signal processing toolkit.

    Instantaneous frequency is a term which seems to be context-sensitive.  In other words the definition can vary depending upon the application.
    Spikes per second would be more of an average frequency (averaged over one second).
    For your neural signals I would think that an instantaneous frequency would be defined as the reciprocal of the time between successive spikes.  Since you can count spikes, you should be able to determine the time of each spike.
    Lynn 

  • How do you calculate multiple fields in a Form?

    Hi,
    I have a spreadsheet with several headings and several fields as illustrated below, and description of each field and calculation required is listed below.
    Rate Per Day
    Days
    Course
    Attending
    Total
    $1,000
    2
    Course A
    Yes
    $2,000
    $2,000
    1
    Course B
    Yes
    $2,000
    $5,000
    5
    Course C
    No
    $2,000
    2
    Course D
    Yes
    $4,000
    Total:
    $8,000
    Rate per day:  Field value is inputted by us.
    Days:  Field value is inputted by us.
    Course:  Field value is inputted by us.
    Attending:  Is actually a check-box that the client ticks.
    Course Total:  This should be the calculation of RATE PER DAY * DAYS IF ATTENDING BOX IS CHECKED
    Total:  Sum of above COURSE TOTAL FIELDS
    We currently do this in EXCEL 2007, however we looking at converting it to a PDF Form for distribution to our clients to we can track responses, etc.
    My question is really ery simple ... how do I create the above calculations in a form that I want to distribute??  This possible?? If so how (please bear in mind I'm not a developer

    In re-reading your question, I realized you're using a check box. In that case, you will need to create a custom calculation script using JavaScript.
    Something like:
    // This is a custom calculation script
    (function () {
        // Get the value of the check box
        var v1 = getField("Attending1").value;
        if (v1 !== "Off") {
            var v2 = +getField("Rate1").value;
            var v3 = +getField("Days1").value;
            // Sum the two field values and set the value of this field to the result
            event.value = v2 + v3;
        } else {
            // Blank field if checkbox is unchecked
            event.value = "";
    You'd replace the field names I used with the field names you're using.
    This leaves out checking to see if the corresponding Couse field is filled-in, and you'll have to use a custom Format script if you want the type of formatting you show.

  • How do you calculate the age of a query?

    Hi,
    We are trying to determine how old a query is?  Do one of the statistical cubes/queries contain the age or created on date of a query?
    Thanks for you help.  Points will be rewarded for the correct answer.
    Thanks,
    Mike

    Hi rathi/mike,
    check these tables RSRREPDIR,RSZCOMPDIR.
    Cheers
    RK

  • How do you calculate difference in time (hours and minutes) between 2 two date/time fields?

    Have trouble creating formula using FormCalc that will calculate difference in time (hours and minutes) from a Start Date/Time field and End Date/Time field. 
    I am using to automatically calculate total time in hours and minutes only of an equipment outage based on a user entered start date and time and end date and time. 
    For example a user enters start date/time of an equipment outage as 14-Oct-12 08:12 AM and then enters an end date/time of the outage of 15-Oct-12 01:48 PM.  I need a return that automatically calculates total time in hours and minutes of the equipment outage.
    Thanks Chris

    Hi,
    In JavaScript you could do something like;
    var DateTimeRegex = /(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d)/;
    var d1 = DateTimeRegex.exec(DateTimeField1.rawValue);
    if (d1 !== null)
        var fromDate = new Date(d1[1], d1[2]-1, d1[3], d1[4], d1[5]);
    var d2 = DateTimeRegex.exec(DateTimeField2.rawValue);
    if (d2 !== null)
        var toDate = new Date(d2[1], d2[2]-1, d2[3], d2[4], d2[5]);
    const millisecondsPerMinute = 1000 * 60;
    const millisecondsPerHour = millisecondsPerMinute * 60;
    const millisecondsPerDay = millisecondsPerHour * 24;
    var interval = toDate.getTime() - fromDate.getTime();
    var days = Math.floor(interval / millisecondsPerDay );
    interval = interval - (days * millisecondsPerDay );
    var hours = Math.floor(interval / millisecondsPerHour );
    interval = interval - (hours * millisecondsPerHour );
    var minutes = Math.floor(interval / millisecondsPerMinute );
    console.println(days + " days, " + hours + " hours, " + minutes + " minutes");
    This assumes that the values in DateTimeField1 and DateTimeField2 are valid, which means the rawValue will be in a format like 2009-03-15T18:15
    Regards
    Bruce

  • How do you calculate the length of a microcassette tape on the M-2000 transcriber?

    There is a counter that runs as you rewind a microcassette tape.  What is the equivalent in minutes?  I would like to know how long the tapes are that I am preparing to type.  Thanks for your prompt reply.

    Unfortunately, we have a very limited information about the M-2000 Micro Cassette Recorder since it was first released in the market last 7/1/1989. Perhaps, the manual here can be of help. 
    If my post answers your question, please mark it as "Accept as Solution"
    http://bit.ly/Win-4K

  • How do you calculate the number of bytes in a hexidecimal array?

    Hi can anybody help me calculate the number of bytes in a hexidecimal array ie:
    04h + 12h + 4Eh + 20h = 84h
    Thanks

    Hi,
    I'm not sure if you want to count the bytes or sum the array. But here's an example of both:
    Hope this helps,
    Paulo
    Attachments:
    ByteCount.vi ‏18 KB

  • HT3728 how do you switch airport base station controls from 1 computer to another?

    I recently purchased a macbook air (love it!) and I'd like to change out the the airport base station control access to my new macbook air from the PC that I initially set it up with. Is this possible to do without having to do a factory reset on my airport base statsion?  My PC is on the verge of klonking out any day...

    You can access your Airport from any device that has the Airport Utility installed as long as you are hardwired or in range of the network - I am not familiar with the new Macbook - it might already have Version 6 in utilities - this is the newest version and it is somewhat streamlined - if you want the same functionality that you are used to in the Windows version, then try and download 5.6 for your Mac - you can also use the mobile version by downloading the app to an Ipad or Iphone but is also a less functional version.

Maybe you are looking for

  • How can I merge documents with layout written with pages? How can I copy pages-document with layout and paste it into another pages document?

    Hi I am working with pages for a book and have made already a layout whre photos and graphs etc. are partly outside of the area for the text, their posotion is not fixed the the text. And now I nedd support: When I add text or a photo to the layout t

  • Lock objects

    Hi experts, My requirement is to create lock for parent table and its child tables.Each and every child tables is having relation with the parent table.   When iam creating the lock for parent table, in this process iam adding the child tables in the

  • Program monitor freezes and goes black but I can still hear the audio

    Hi just recently I've noticed after a few playbacks the program monitor goes black, the sequence plays out with audio, I just can't see the image. Timeline is mixed with prores, mts But haven't had this issue occur since updating. THanks I7 3970 gtx

  • Studio 3.1 & Portal 9.2 - JSF portlet problem

    Hi, first time here. Let say I have create a simple jsf navigation application using Studio 3.1 like this: // inside faces-config.xml <navigation-rule> <from-view-id>/pages/inputname.jsp</from-view-id> <navigation-case> <from-outcome>greeting</from-o

  • Very bad performance

    I have mabook pro mid 2012. Memory 8 GB, SSD 256 GB. After update to yosemite, my performance is very bad. this screens of usage cpu https://www.evernote.com/shard/s301/sh/ec3e4aaf-8c39-4971-bd4d-6343e040516c/cfe5 2044dd723500517a1b0630bc07cc/deep/0/