summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--INSTALL.ja21
-rw-r--r--README.ja.md126
-rw-r--r--src/math.c168
3 files changed, 0 insertions, 315 deletions
diff --git a/INSTALL.ja b/INSTALL.ja
deleted file mode 100644
index 032f91f41..000000000
--- a/INSTALL.ja
+++ /dev/null
@@ -1,21 +0,0 @@
-* コンパイル・インストール
-
-以下の手順で行ってください.
-
- 1. makeを実行してコンパイルする
-
- 以下のディレクトリにライブラリおよびバイナリが作成されます。
-
- * bin
- * lib
- * include
-
-もし,コンパイル時にエラーが発生した場合にはエラーのログとマ
-シン,OSの種類を含むできるだけ詳しいレポートを作者に送ってく
-ださると他の方のためにもなります.
-
-
-* 移植
-
-
-以上 \ No newline at end of file
diff --git a/README.ja.md b/README.ja.md
deleted file mode 100644
index ec3c6166d..000000000
--- a/README.ja.md
+++ /dev/null
@@ -1,126 +0,0 @@
-# !!ご注意!!
- これはチーム内レビューの為の事前公開です。
- 記述されているURLやメールアドレスは現在使用できません。
- 正式リリースは後日アナウンス予定です。
-
- 修正のご指摘は随時受け付けていますが、対応が遅れる可能性があります。
- 予めご了承ください。
-
-## mrubyとは
-
-mrubyは[ISO規格](http://www.ipa.go.jp/about/press/20120402_2.html)に準拠したRuby言語を様々な環境で動作可能となるように
-軽量化したものです。モジュール構成によりインタプリタ実行形式や
-コンパイル&VM実行形式でも動作させることができます。
-
-2010年度の経済産業省の地域イノベーション創出事業により開発されました。
-
-
-## mrubyの特長
-
- |MRI(Matz Ruby Implementation)版との互換性
- |
- |以下要修正
- | + シンプルな文法
- | + 普通のオブジェクト指向機能(クラス,メソッドコールなど)
- | + 特殊なオブジェクト指向機能(Mixin, 特異メソッドなど)
- | + 演算子オーバーロード
- | + 例外処理機能
- | + イテレータとクロージャ
- | + ガーベージコレクタ
- | + ダイナミックローディング (アーキテクチャによる)
- | + 移植性が高い.多くのUnix-like/POSIX互換プラットフォーム上で
- | 動くだけでなく,Windows, Mac OS X,BeOSなどの上でも動く
- | cf. http://redmine.ruby-lang.org/wiki/ruby-19/SupportedPlatformsJa
-
-
-## 入手法
-
-### Zipで
-
-以下の場所においてあります。
-
- https://github.com/mruby/mruby/zipball/master
-
-### GitHubで
-
-開発先端のソースコードは次のコマンドで取得できます。
-
- $ git clone https://github.com/mruby/mruby.git
-
-他に開発中のブランチの一覧は次のコマンドで見られます。
-
- $ git branch -r
-
-
-## ホームページ
-
-まだ準備中です。ただいま鋭意製作中です。
-
-mrubyのホームページのURLは
-
- http://www.mruby.org/
-
-になる予定です。
-
-
-## メーリングリスト
-
-mrubyのメーリングリストがあります。参加希望の方は....[T.B.D.]
-
-
-mruby開発者向けメーリングリストもあります。こちらではrubyのバグ、
-将来の仕様拡張など実装上の問題について議論されています。
-参加希望の方は....[T.B.D.]
-
-
-## コンパイル・インストール・移植
-
-INSTALL.ja ファイルを参照してください。
-
-
-## 配布条件
-
-Copyright (c) 2012 mruby developers
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-
-## ライセンスについて
-
-mrubyは組込み機器などの様々な環境で利用させることを期待し、ライセンスを
-比較的制限の緩いMITライセンスにすることにいたしました。
-しかしながら、ライセンスの実行条件としてマニュアル等の何らかの形で
-著作権表記及びライセンス文を記述する必要があります。
-昨今の規模の大きくなったシステムではこれらの対応も相当の煩雑さを伴います。
-そこで、mrubyではできる限り表記を簡便にするために、便宜上、著作権者名を
-"mruby developers"とすることにいたしました。
-今後、新たにmrubyへのコミットされるコードについては、著作権を保持したまま、
-"mruby developers"の一員としてMITライセンスでの配布をお願いしたいと
-考えています。
-(コミットしたコードの著作権を譲渡や放棄をお願いするものではありません。
- 希望があれば、著作者名はAUTHORSファイルに表記いたします。)
-
-尚、その他のライセンスでの配布やGPL由来のコードのコミットについては
-別途ご相談ください。
-
-## コントリビュートについて
-
-<http://github.com/mruby/mruby>にpull requestを送ってください。
-pull requestに含まれるコードについてMITライセンスでの配布を承諾したものとみなします。
-もし、mruby developersとして名前を残したいということであれば、
-pull requestにAUTHORSファイルへの修正を含めてください。
diff --git a/src/math.c b/src/math.c
index 78ef95697..3fc5090cf 100644
--- a/src/math.c
+++ b/src/math.c
@@ -5,32 +5,8 @@
*/
#include "mruby.h"
-
#include <math.h>
-#if defined(__FreeBSD__) && __FreeBSD__ < 4
-#include <floatingpoint.h>
-#endif
-
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif
-
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-
-#define SIGNED_VALUE intptr_t
-
-#ifdef MRB_USE_FLOAT
-#define floor(f) floorf(f)
-#define ceil(f) ceilf(f)
-#define floor(f) floorf(f)
-#define fmod(x,y) fmodf(x,y)
-#endif
-
-#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
-
#define domain_error(msg) \
mrb_raise(mrb, E_RANGE_ERROR, "Numerical argument is out of domain - " #msg);
@@ -185,22 +161,6 @@ math_atan2(mrb_state *mrb, mrb_value obj)
/*
HYPERBOLIC TRIG FUNCTIONS
*/
-#ifndef HAVE_SINH
-double
-sinh(double x)
-{
- return (exp(x) - exp(-x)) / 2;
-}
-#endif
-
-#ifndef HAVE_TANH
-double
-tanh(double x)
-{
- return sinh(x) / cosh(x);
-}
-#endif
-
/*
* call-seq:
* Math.sinh(x) -> float
@@ -568,131 +528,6 @@ math_erfc(mrb_state *mrb, mrb_value obj)
return mrb_float_value(x);
}
-/*
- * call-seq:
- * Math.gamma(x) -> float
- *
- * Calculates the gamma function of x.
- *
- * Note that gamma(n) is same as fact(n-1) for integer n > 0.
- * However gamma(n) returns float and can be an approximation.
- *
- * def fact(n) (1..n).inject(1) {|r,i| r*i } end
- * 1.upto(26) {|i| p [i, Math.gamma(i), fact(i-1)] }
- * #=> [1, 1.0, 1]
- * # [2, 1.0, 1]
- * # [3, 2.0, 2]
- * # [4, 6.0, 6]
- * # [5, 24.0, 24]
- * # [6, 120.0, 120]
- * # [7, 720.0, 720]
- * # [8, 5040.0, 5040]
- * # [9, 40320.0, 40320]
- * # [10, 362880.0, 362880]
- * # [11, 3628800.0, 3628800]
- * # [12, 39916800.0, 39916800]
- * # [13, 479001600.0, 479001600]
- * # [14, 6227020800.0, 6227020800]
- * # [15, 87178291200.0, 87178291200]
- * # [16, 1307674368000.0, 1307674368000]
- * # [17, 20922789888000.0, 20922789888000]
- * # [18, 355687428096000.0, 355687428096000]
- * # [19, 6.402373705728e+15, 6402373705728000]
- * # [20, 1.21645100408832e+17, 121645100408832000]
- * # [21, 2.43290200817664e+18, 2432902008176640000]
- * # [22, 5.109094217170944e+19, 51090942171709440000]
- * # [23, 1.1240007277776077e+21, 1124000727777607680000]
- * # [24, 2.5852016738885062e+22, 25852016738884976640000]
- * # [25, 6.204484017332391e+23, 620448401733239439360000]
- * # [26, 1.5511210043330954e+25, 15511210043330985984000000]
- *
- */
-static mrb_value
-math_gamma(mrb_state *mrb, mrb_value obj)
-{
- static const double fact_table[] = {
- /* fact(0) */ 1.0,
- /* fact(1) */ 1.0,
- /* fact(2) */ 2.0,
- /* fact(3) */ 6.0,
- /* fact(4) */ 24.0,
- /* fact(5) */ 120.0,
- /* fact(6) */ 720.0,
- /* fact(7) */ 5040.0,
- /* fact(8) */ 40320.0,
- /* fact(9) */ 362880.0,
- /* fact(10) */ 3628800.0,
- /* fact(11) */ 39916800.0,
- /* fact(12) */ 479001600.0,
- /* fact(13) */ 6227020800.0,
- /* fact(14) */ 87178291200.0,
- /* fact(15) */ 1307674368000.0,
- /* fact(16) */ 20922789888000.0,
- /* fact(17) */ 355687428096000.0,
- /* fact(18) */ 6402373705728000.0,
- /* fact(19) */ 121645100408832000.0,
- /* fact(20) */ 2432902008176640000.0,
- /* fact(21) */ 51090942171709440000.0,
- /* fact(22) */ 1124000727777607680000.0,
- /* fact(23)=25852016738884976640000 needs 56bit mantissa which is
- * impossible to represent exactly in IEEE 754 double which have
- * 53bit mantissa. */
- };
- double intpart, fracpart;
- mrb_float x;
- mrb_get_args(mrb, "f", &x);
-
- /* check for domain error */
- if (isinf(x) && signbit(x)) domain_error("gamma");
- fracpart = modf(x, &intpart);
- if (fracpart == 0.0) {
- if (intpart < 0) domain_error("gamma");
- if (0 < intpart &&
- intpart - 1 < (double)numberof(fact_table)) {
- return mrb_float_value(fact_table[(int)intpart - 1]);
- }
- }
- return mrb_float_value(tgamma(x));
-}
-
-
-/*
- * call-seq:
- * Math.lgamma(x) -> [float, -1 or 1]
- *
- * Calculates the logarithmic gamma of x and
- * the sign of gamma of x.
- *
- * Math.lgamma(x) is same as
- * [Math.log(Math.gamma(x).abs), Math.gamma(x) < 0 ? -1 : 1]
- * but avoid overflow by Math.gamma(x) for large x.
- */
-
-/* TODO: lgamma_r() is missing */
-
-/*
-static mrb_value
-math_lgamma(mrb_state *mrb, mrb_value obj)
-{
- double d0, d;
- int sign=1;
- mrb_float x;
- mrb_get_args(mrb, "f", &x);
-
- // check for domain error
- if (isinf(x)) {
- if (signbit(x)) domain_error("lgamma");
- return rb_assoc_new(mrb_float_value(INFINITY), mrb_fixnum_value(1));
- }
- d = lgamma_r(x, &sign);
- return mrb_assoc_new(mrb, mrb_float_value(d), mrb_fixnum_value(sign));
-}
-*/
-
-
-
-
-
/* ------------------------------------------------------------------------*/
void
mrb_init_math(mrb_state *mrb)
@@ -742,7 +577,4 @@ mrb_init_math(mrb_state *mrb)
mrb_define_class_method(mrb, mrb_math, "erf", math_erf, 1);
mrb_define_class_method(mrb, mrb_math, "erfc", math_erfc, 1);
-
- mrb_define_class_method(mrb, mrb_math, "gamma", math_gamma, 1);
- /* mrb_define_class_method(mrb, mrb_math, "lgamma", math_lgamma, 1); */
}