mpfr

    1熱度

    1回答

    我試圖計算指數的自然對數加上數組的中值,但浮點數的精度必須在2000或答案將始終爲0. 這是我到目前爲止有: import bigfloat x = np.array([-15349.79, -15266.66, -15242.86]) answer = np.median(x) - bigfloat.log(np.mean(bigfloat.exp(x, precision(2000))

    1熱度

    1回答

    我有一個變量,它包含mpfr對象。 > currentPrice <- mpfr(as.character(reduceData[1, 2])) > currentPrice 1 'mpfr' number of precision 97 bits [1] 14.22857142857142857142857143301 我怎麼能寫這個值的文本文件,無需切割,並tranforming短的

    1熱度

    1回答

    我試圖安裝bigfloat,我收到這個消息,似乎表明我需要首先使用mpfr庫。我該怎麼做呢? 消息: running build_ext building 'mpfr' extension creating build/temp.linux-x86_64-2.7 x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwra

    1熱度

    1回答

    我試圖在小數點後打印更多數字。所以用了「mpfr」功能。但是,爲什麼我會得到這個結果呢? > mpfr(1/5, 120) 1 'mpfr' number of precision 120 bits [1] 0.20000000000000001110223024625156540424 爲什麼打印「1110223024625156540424」後的結果爲0?

    0熱度

    1回答

    編譯錯誤與MPFR軟件包,當我嘗試編譯新安裝的軟件包MPFR我收到以下錯誤: Undefined symbols for architecture x86_64: "_mpfr_init2", referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker c

    0熱度

    1回答

    我試圖將MPFR號碼轉換爲字符串,然後返回。我正在使用的代碼是: int base = 10; int input = 25; mpfr_t number; mpfr_inits2(53, number, (mpfr_ptr) 0); mpfr_set_d(number, input, MPFR_RNDD); mpfr_printf ("mpfr = %.17Rg\n", number

    -2熱度

    1回答

    我遇到了一個問題,我不知道從哪裏開始。我在筆記本電腦上開發了代碼,並且工作正常。我搬到另一臺電腦,現在我編譯時, error: unknown type name 'mpfr_exp_t' mpfr庫位於兩臺計算機上的相同位置。任何人都可以給我一個線索如何在新電腦上了解什麼是錯的?

    0熱度

    1回答

    考慮下面的代碼: #include <iostream> #include <mpreal.h> using namespace std; using mpfr::mpreal; mpreal x("1.001",64); mpreal y("1.0",64); y*=x; cout<<y<<endl; //1 y.set_prec(128); cout<<y<<endl; /

    0熱度

    1回答

    我遇到了將std :: pair,mpfr_t>類型的元素插入到地圖中的麻煩。性病:: make_pair函數調用錯誤 不兼容的類型「__mpfr_struct *」的分配「__mpfr_struct [1]」 因爲我只是一個指針傳遞到mpfr_t對象我以爲rec_func功能我可以使用*運算符對其進行取消引用,並將生成的mpfr_t作爲值保存在地圖中。 背景信息和代碼結構:rec_func是一個

    0熱度

    1回答

    我已經將基本C++代碼從文本文件讀入C++並使用該庫解決了廣義特徵值問題。這完美的工作,並給我預期的結果,當使用數據類型double和MatrixXd。 對於特定的實例,此代碼將需要以更高的精度運行。從看文檔,徵有mpfr support這是我一直在努力實現,但得到的錯誤: Segmentation fault (core dumped) 我已經縮小的問題,以讀取在從文本文件中的矩陣代碼。在使