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 6327615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:18:40+00:00 2026-05-24T17:18:40+00:00

I needed to calculate exponents using GWT 2.3 in Java. ie: x^y. There’s no

  • 0

I needed to calculate exponents using GWT 2.3 in Java. ie: x^y. There’s no native power operator in Java, normally you have to import java.lang.Math to use the pow() method. But you cannot do that in GWT client side (I think?).

I did temporarily solve the problem by creating my own pow() method. But I’d guess what I wrote is probably inefficient and not as good as a native solution.

private long pow(int b, int e) {
    long result = 1;
    for (int i = 0; i < e; i++) {
        result *= b;
    }
    return result;
}

So I googled for a better solution than mine and found a few people using third party libraries such as com.googlecode.gwt.math.Math. But I also found others saying these libraries only worked for GWT 2.0 or earlier because from 2.1 it was integrated within GWT. But I couldn’t find any help on how to use these integrated math libraries in 2.3.

What exactly do I need to import? And how exactly do I use these libraries? Where exactly can I find official GWT documentation on these? Are they really integrated? Or should I just keep using my own method above?

  • 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-24T17:18:41+00:00Added an answer on May 24, 2026 at 5:18 pm

    GWT can translate java.lang.Math.pow(). See this page for what parts of the Java runtime library can be emulated in Javascript by GWT.

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

Sidebar

Related Questions

Recently I was trying to determine the time needed to calculate a waveform using
I need to calculate numbers of money notes needed for salary preparation. I have
Let's say I have a function which can calculate power of four of a
Is there some kind of function which can calculate how many keystrokes are needed
I needed to convert a Java 1.5se app to C# 2.0. Does anyone know
I am using an NSTimer which I have working to show minutes and seconds.
There exists an unknown target location (latitude and longitude co-ordinates). I have 3 latitude
I'm trying to find the best way to calculate the box size needed for
I needed to calculate the time it takes to run a certain function and
Scenario: Web Service needed to calculate values and send results back as json. These

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.