square-root

    0熱度

    1回答

    (增加重複的例子) sqrt(as.complex(c(4,9,-4,-9,16))) # 2+0i 3+0i 0+2i 0+3i 4+0i class(sqrt(as.complex(c(4,9,-4,-9,16)))) # complex sqrt(as.complex(c(4,9,-4,-9,16)))[1] # 2+0i class(sqrt(as.complex(c(4,9,-4,

    2熱度

    1回答

    我正在尋找一些平方根計算算法,並發現這個源文件。我想嘗試複製它,因爲它看起來很簡單,但我不能將它與一些已知的算法(牛頓,巴比倫...)聯繫起來。你能告訴我這個名字嗎? int sqrt(int num) { int op = num; int res = 0; int one = 1 << 30; // The second-to-top bit is set: 1L

    1熱度

    1回答

    所以我在C#中編寫了一個二次公式程序,我如何取二次公式程序並對其進行修改,以便程序正確顯示解決方案的數量。 如果有兩個解決方案, (x - x1)(x - x2) = 0 如果只有一個解決方案, (x - x0)^2 = 0 如果沒有解決方案, 無解。 這是一個程序,如果有人能爲我展示這個解決方案對我來說將是美好的,我真的被困在如何去做。 using System; namespace

    0熱度

    2回答

    我有n個元素的以下兩個numpy的數組: A = np.array([2 5 8 9 8 7 5 6]) B = np.array([8 9 6 5 2 8 5 7]) 我想獲得陣列C: C = np.array([sqrt(2^2+8^2) sqrt(5^2+9^2) ... sqrt(6^2+7^2)]) 即,列C將包括n個元素的;每個元素將等於A中相應元素的平方的平方根加上B中相應

    1熱度

    1回答

    好的,所以我剛剛開始學習Java兩天前。我正在使用Java SE和Netbeans 8.0.2,並且已經編寫了一些非常基本的應用程序。但是,我試圖找到一個32-64位數字(一個「長」)的平方根,我不斷收到錯誤。我究竟做錯了什麼? class Root { public static void main(String[] arguements) { long number;

    0熱度

    2回答

    我想創建一個循環,在我的範圍變量中的每個數字正方形,然後找到該數字的平方根。 import UIKit var range = 0..<10 var square = 0.0 var root = 0.0 for i in range { square = i * i root = sqrt(square) print(square) } 我現在的錯

    0熱度

    2回答

    我收到語法錯誤:Traceback(最近調用最後一次): 文件「python」,第4行,在 TypeError:不支持的操作數類型爲**或POW():「統一」和「廉政」 編輯:好了,所以這是我的新的代碼,一旦它這樣做,直到你輸入的東西是不是數字 您可以輸入另一個號碼,它會重置 while True: print 'Welcome to the "Square Root Calculato

    2熱度

    1回答

    #include<iostream> #include<cmath> using namespace std; double bisection(double errorVal, double userNum){ double upper=userNum, lower=0; double mid=(lower+upper)/2.0;; while(mid*mid

    0熱度

    1回答

    #include<iostream> #include<cmath> #include<iomanip> using namespace std; double bisection(double errorVal, double userNum){ double upper=userNum, lower=0; double mid=(lower+upper)/2.0;

    0熱度

    2回答

    對於在命令行中運行的PHP(5.6)腳本,我試圖打印平方根符號,但未能這樣做。相反,我得到垃圾角色。 我已經閱讀了關於從PHP CLI向命令行打印unicode字符的許多問題/答案,但沒有一個與我的示例完全相關。 我在使用標準命令提示符(cmd.exe)的Windows 10上,我很高興使用它。 我使用Consolas字體並運行chcp 65001來將提示設置爲utf-8。 *也試過Lucida遊