sqrt

    -3熱度

    3回答

    我試圖找到一種方式來獲得一個開方沒有內置插件,來到了第i個本,不幸的是它不會工作,我不知道爲什麼 double num=0; while ((num*num)!=this.first) num=num+0.0001; return num;

    -4熱度

    4回答

    //Add comments here that explain the Sqrt method private void btnSqrt_Click(object sender, EventArgs e) { double num = double.Parse(textDisplay.Text); if (num >= 0) {

    1熱度

    2回答

    public class Sqrt { public static void main(String[] args) { double EPS = 1E-15; double c = Double.parseDouble(args[0]); double t = c; while (Math.abs(t -

    0熱度

    3回答

    我的代碼不會運行我得到的錯誤「無法在原始類型double上調用sqrt(double)」這就是我編譯它時得到的唯一錯誤,否則除Math.sqrt(數學)行外不會導致錯誤。幫幫我? public class Confused { public static double average(int x, int y) { double ave= (x+y)/2.0; return ave; }

    3熱度

    4回答

    我正在製作一個在線RPG遊戲,我使用這個數學公式(在線找到)來計算exp - > level。 $level = (25 + sqrt(625 + 100 * $exp))/50; 我已經嘗試了幾天,使腳本來扭轉它。 我的目標是製作一個函數來計算一個關卡所需的exp的數量。

    1熱度

    2回答

    即使我使用math.h頭文件並且使用了雙精度數據,但在C中使用sqrt函數時遇到了問題。當試圖運行下面的代碼: #include <stdio.h> #include <math.h> int main(int argc, char **argv) { int J = 1000000; sieve(J); } int sieve(int J) { int P[J+1]; P[

    0熱度

    2回答

    #include <iostream> #include <conio.h> #include <math.h> using namespace std; int main() { float xstart = -2, xfinal = 2, h = 0.5; float t, y; cout << "X start = -2" << endl;

    0熱度

    1回答

    我想在彙編中編寫一個快速整數平方根算法,它採用無符號32位。我一直在閱讀this,並有一個想法。這裏是我的僞代碼: res <- 0 for i from 15 downto 0 do: change the ith bit of result to 1 if res^2 > x then: change the ith bit of res back to 0

    2熱度

    3回答

    我們發現代替std::sqrt(Timing Square Root)和std::exp(Using Faster Exponential Approximation)的一些技巧,但我找不到替代std::log的東西。它是我程序中循環的一部分,它被多次調用,而exp和sqrt被優化,因此英特爾VTune現在建議我優化std::log,之後似乎只有我的設計選擇會受到限制。 很多謝謝。

    2熱度

    1回答

    我做什麼,我認爲是一個很好的fixed-point square root algorithm: template<int64_t M, int64_t P> typename enable_if<M + P == 32, FixedPoint<M, P>>::type sqrt(FixedPoint<M, P> f) { if (f.num == 0) return 0