diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-24 08:53:56 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-24 08:53:56 +0000 |
commit | ee9d5d41d178c21594891c9d876f228dc509ce0b (patch) | |
tree | 86e378374a47432b780b795dc8d361a30f60b68c | |
parent | e274c3ab76ca95dd089b6ef467700b4a0576dfad (diff) | |
download | ruby-ee9d5d41d178c21594891c9d876f228dc509ce0b.tar.gz |
021224
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | eval.c | 2 | ||||
-rw-r--r-- | numeric.c | 46 | ||||
-rw-r--r-- | parse.y | 18 | ||||
-rw-r--r-- | version.h | 15 |
5 files changed, 69 insertions, 16 deletions
@@ -1,3 +1,7 @@ +Tue Dec 24 17:02:46 2002 Yukihiro Matsumoto <matz@ruby-lang.org> + + * eval.c (rb_undefined): use NoMethodError instead of fatal. + Tue Dec 24 02:12:45 2002 Akinori MUSHA <knu@iDaemons.org> * lib/README: Synchronize with reality. @@ -4465,7 +4465,7 @@ rb_undefined(obj, id, argc, argv, call_status) POP_FRAME(); } else if (id == ID_ALLOCATOR) { - rb_fatal("allocator undefined for %s", rb_class2name(obj)); + rb_raise(rb_eNoMethodError, "allocator undefined for %s", rb_class2name(obj)); } nargv = ALLOCA_N(VALUE, argc+1); @@ -22,8 +22,39 @@ #include <float.h> #endif +/* use IEEE 64bit values if not defined */ +#ifndef FLT_RADIX +#define FLT_RADIX 2 +#endif +#ifndef FLT_ROUNDS +#define FLT_ROUNDS 1 +#endif +#ifndef DBL_MIN +#define DBL_MIN 2.2250738585072014e-308 +#endif +#ifndef DBL_MAX +#define DBL_MAX 1.7976931348623157e+308 +#endif +#ifndef DBL_MIN_EXP +#define DBL_MIN_EXP (-1021) +#endif +#ifndef DBL_MAX_EXP +#define DBL_MAX_EXP 1024 +#endif +#ifndef DBL_MIN_10_EXP +#define DBL_MIN_10_EXP (-307) +#endif +#ifndef DBL_MAX_10_EXP +#define DBL_MAN_10_EXP 308 +#endif +#ifndef DBL_DIG +#define DBL_DIG 15 +#endif +#ifndef DBL_MANT_DIG +#define DBL_MANT_DIG 53 +#endif #ifndef DBL_EPSILON -#define DBL_EPSILON 2.2204460492503131E-16 +#define DBL_EPSILON 2.2204460492503131e-16 #endif static ID id_coerce, id_to_i, id_div; @@ -1767,6 +1798,18 @@ Init_Numeric() rb_define_singleton_method(rb_cFloat, "induced_from", rb_flo_induced_from, 1); rb_include_module(rb_cFloat, rb_mPrecision); + rb_define_const(rb_cFloat, "ROUNDS", INT2FIX(FLT_ROUNDS)); + rb_define_const(rb_cFloat, "RADIX", INT2FIX(FLT_RADIX)); + rb_define_const(rb_cFloat, "MANT_DIG", INT2FIX(DBL_MANT_DIG)); + rb_define_const(rb_cFloat, "DIG", INT2FIX(DBL_DIG)); + rb_define_const(rb_cFloat, "MIN_EXP", INT2FIX(DBL_MIN_EXP)); + rb_define_const(rb_cFloat, "MAX_EXP", INT2FIX(DBL_MAX_EXP)); + rb_define_const(rb_cFloat, "MIN_10_EXP", INT2FIX(DBL_MIN_10_EXP)); + rb_define_const(rb_cFloat, "MAX_10_EXP", INT2FIX(DBL_MAX_10_EXP)); + rb_define_const(rb_cFloat, "MIN", rb_float_new(DBL_MIN)); + rb_define_const(rb_cFloat, "MAX", rb_float_new(DBL_MAX)); + rb_define_const(rb_cFloat, "EPSILON", rb_float_new(DBL_EPSILON)); + rb_define_method(rb_cFloat, "to_s", flo_to_s, 0); rb_define_method(rb_cFloat, "coerce", flo_coerce, 1); rb_define_method(rb_cFloat, "-@", flo_uminus, 0); @@ -1801,4 +1844,3 @@ Init_Numeric() rb_define_method(rb_cFloat, "infinite?", flo_is_infinite_p, 0); rb_define_method(rb_cFloat, "finite?", flo_is_finite_p, 0); } - @@ -41,7 +41,7 @@ #define ID_JUNK 0x07 #define ID_INTERNAL ID_JUNK -#define is_notop_id(id) ((id)>LAST_TOKEN) +#define is_notop_id(id) ((id)>tLAST_TOKEN) #define is_local_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL) #define is_global_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL) #define is_instance_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE) @@ -286,7 +286,7 @@ static void top_local_setup(); * precedence table */ -%nonassoc LOWEST +%nonassoc tLOWEST %nonassoc tLBRACE_ARG %left kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD @@ -309,7 +309,7 @@ static void top_local_setup(); %right '!' '~' tUPLUS tUMINUS %right tPOW -%token LAST_TOKEN +%token tLAST_TOKEN %% program : { @@ -631,7 +631,7 @@ cmd_brace_block : tLBRACE_ARG } ; -command : operation command_args %prec LOWEST +command : operation command_args %prec tLOWEST { $$ = new_fcall($1, $2); fixpos($$, $2); @@ -648,7 +648,7 @@ command : operation command_args %prec LOWEST } fixpos($$, $2); } - | primary_value '.' operation2 command_args %prec LOWEST + | primary_value '.' operation2 command_args %prec tLOWEST { $$ = new_call($1, $3, $4); fixpos($$, $1); @@ -665,7 +665,7 @@ command : operation command_args %prec LOWEST } fixpos($$, $1); } - | primary_value tCOLON2 operation2 command_args %prec LOWEST + | primary_value tCOLON2 operation2 command_args %prec tLOWEST { $$ = new_call($1, $3, $4); fixpos($$, $1); @@ -5550,7 +5550,7 @@ Init_sym() sym_rev_tbl = st_init_numtable_with_size(200); } -static ID last_id = LAST_TOKEN; +static ID last_id = tLAST_TOKEN; static ID internal_id() @@ -5608,7 +5608,7 @@ rb_intern(name) strncpy(buf, name, last); buf[last] = '\0'; id = rb_intern(buf); - if (id > LAST_TOKEN && !is_attrset_id(id)) { + if (id > tLAST_TOKEN && !is_attrset_id(id)) { id = rb_id_attrset(id); goto id_regist; } @@ -5640,7 +5640,7 @@ rb_id2name(id) { char *name; - if (id < LAST_TOKEN) { + if (id < tLAST_TOKEN) { int i = 0; for (i=0; op_tbl[i].token; i++) { @@ -1,4 +1,11 @@ -#define RUBY_VERSION "1.7.3" -#define RUBY_RELEASE_DATE "2002-12-20" -#define RUBY_VERSION_CODE 173 -#define RUBY_RELEASE_CODE 20021220 +#define RUBY_VERSION "1.8.0" +#define RUBY_RELEASE_DATE "2002-12-24" +#define RUBY_VERSION_CODE 180 +#define RUBY_RELEASE_CODE 20021224 + +#define RUBY_VERSION_MAJOR 1 +#define RUBY_VERSION_MINOR 8 +#define RUBY_VERSION_TEENY 0 +#define RUBY_RELEASE_YEAR 2002 +#define RUBY_RELEASE_MONTH 12 +#define RUBY_RELEASE_DAY 24 |