From: kjana@... (YANAGAWA Kazuhisa) Date: 1999-03-07T00:36:56+09:00 Subject: [ruby-dev:6049] Re: Bigfloat [compare to NaN] In message <199903051532.AAA00477.keiju@bc.mbn.or.jp> keiju@rational.com (=?ISO-2022-JP?B?GyRCQFBETTc9PHkbKEI=?= ) writes: > >keiju> mpって四則演算だけですよね? それだったらあまり採用してもね... > > > >そうですね、四則の他は 2 ^ n, abs, sqrt や比較程度なので、 > >スタートラインとしては、かなり厳しいかも知れない ^^;;; > > ですね. SAL をあさってみたら(float と precision で検索)いくつかそれなりに面 白そうな物がありました.... gmp ベースの C++ クラスライブラリ CL2 とか.hfloat とか.cephes の qfloat とか.任意精度,というわけではないのが多いですが,qfloat なんか は参考にするにはよさそうです. # hfloat の web ページからたどっていくと,何かこの手のライブラリは結構 # あるようです.でも自動的な精度の変換までサポートするものはどうだろう. short または int の配列で数を表し,計算する.精度の変換が無いどころか 完全に固定精度ではありますが,C のライブラリである事と関数がたくさん付 いているのはいいかも.qfloat だけで 三角関数,対数,冪乗,指数,平方根 に立方根に丸めぐらいはありますね. 以下 cephes.doc のあたまだけ.... CEPHES MATHEMATICAL FUNCTION LIBRARY This computer software library is a collection of more than 400 high quality mathematical routines for scientific and engineering applications. All are written entirely in C language. Many of the functions are supplied in six different arithmetic precisions: 32 bit single (24-bit significand), 64 bit IEEE double (53-bit), 64 bit DEC (56-bit), 80 or 96 bit IEEE long double (64-bit), and extended precision formats having 144-bit and 336-bit significands. The extended precision arithmetic is included with the function library. The library treats about 180 different mathematical functions. In addition to the elementary arithmetic and transcendental routines, the library includes a substantial collection of probability integrals, Bessel functions, and higher transcendental functions. # すぐに代数ライブラリや何かになってしまうので,単純な bigfloat のみを # 実装しているライブラリを探す方が難しかったり (^^; -- 柳川和久 @ 東大阪市 . 大阪府 March 7, 1999 「たぶん....ケセランパセランか,ホタルか,風に吹かれた綿菓子か, マルチーズか,トゥクトゥプか,ティラミスか....ま,そんなものよ」 「桜子ちゃん意地悪い」