Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7093109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:23:53+00:00 2026-05-28T08:23:53+00:00

I am trying to take two numbers and get the square of them. Using

  • 0

I am trying to take two numbers and get the square of them. Using several numbers some work, but this one is giving me problems pow(.0305,2). Using a calculator i get an answer of: 0.093025; but when I use java i get an answer of:9.609999999999999E-4. I need .0305 because I am taking 3.05/100 which is .0305.

I have found through trial that if I do .pow(.305,2), that does give me my need answer, but then I would have to get that with 3.05/100.

EDIT:(adding code)

double weight=3.05;
double TapeLength=100.00;
double ftwt= weight/TapeLength; this gives me: 0.093025
double ftwt= Math.pow(ftwt,2); //this gives me: 9.3025E-4 

everything is cast as a double.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:23:54+00:00Added an answer on May 28, 2026 at 8:23 am

    If you’re really getting 9.609999999999999E-4 as the result, you’re doing something wrong other than what you have in you question. The following code (in Eclipse 3.7.1):

    class Test {
        public static void main(String args[]) {
            double dd = .0305;
            System.out.println (Math.pow(dd, 2));
            System.out.println ("%.8f\n", Math.pow(dd, 2));
        }
    }  
    

    produces:

    9.3025E-4
    0.00093025
    

    which are both correct (a), just expressed in different output formats. The default for double is exponential format in this case but the last line shows how you can get different formats.


    (a) Just on the off chance that you’re confused by the exponential form (based on your comments), 0.00093025 is the same as 9.3025E-4 since the latter means9.3025 x 10-4 (9.3025 with the decimal point shifted four positions to the left.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

trying to take this content: <div class=content>one,two,three</div> <div class=content>four,five,six</div> <div class=content>seven,eight,nine</div> and .split and
I'm trying to take one group and put it in two different columns. I
Using six-bit one's and two's complement representation I am trying to solve the following
I'm trying to take two 7 digit numbers (source and target record counts) and
While trying to take some arguments for C. I found it really difficult to
I am trying to take one form type and display it however times i
I have two tables points and contacts and I'm trying to get the average
I'm trying to get MSMQ 5 working on my two Windows Server 2008 R2
I'm trying to see what is the time complexity of addition of two numbers.
I am trying to take numbers from three EditText boxes that the user fills

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.