akr
0da3fc65db
* time.c (timew2timespec): fix previous change.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 21:57:53 +00:00
akr
7b83aa4f3c
* time.c (wdivmod): renamed from wdivmodv. fix neg/pos and pos/neg.
...
(split_second): return number of seconds as wideval_t.
(timet2wv): new function.
(wv2timet): new function.
(timet2wideval): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 15:34:33 +00:00
akr
39146c6b6b
* time.c: use more polymorphic operations.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 13:25:57 +00:00
akr
c4845fdf36
* time.c: reorder wide value implementation.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 13:07:48 +00:00
akr
08f828002b
* time.c: make wide value more polymorphic.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 12:58:34 +00:00
akr
0cf5d3fa96
fix previous commit for LP64.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 12:00:31 +00:00
akr
a00c1c00c1
* time.c (w2v): renamed from w2xv.
...
(v2w): renamed from xv2w.
(rb_time_magnify): takes wideval_t.
(rb_time_unmagnify): returns wideval_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 11:57:03 +00:00
akr
6c7edcb00a
update doc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 00:12:21 +00:00
akr
33d1647252
* time.c: wide value condition changed.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-29 10:47:00 +00:00
akr
d8cc6ccb56
* time.c (rb_time_magnify): fix for LP64.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-28 01:13:00 +00:00
akr
c08277c62d
* time.c: rename small integer specialization related identifiers.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-28 00:54:29 +00:00
akr
86aa8f3f0f
* time.c (weq): optimize for small integer.
...
(wne): ditto.
(wlt): ditto.
(wgt): ditto.
(wle): ditto.
(wge): ditto.
(rb_time_magnify): ditto.
(rb_time_unmagnify): ditto.
(rb_time_unmagnify_to_float): new function to avoid rational for
Time#to_f and Time#-.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-27 23:24:20 +00:00
akr
075cbd2ad6
* time.c (mul): condition refined.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-27 22:14:23 +00:00
akr
f0aa9838a2
* time.c: fix previos commit.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-27 17:14:13 +00:00
akr
cea57f8fff
* time.c: use 64bit arithmetic even on platforms with 32bit VALUE.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-27 14:18:08 +00:00
akr
7c269e72ef
* time.c (time_round): new method Time#round. [ruby-dev:40595]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-11 13:39:12 +00:00
akr
795b03c71c
* time.c (time_add): propagate fixed time offset.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-15 13:21:10 +00:00
nobu
b3085ba508
* time.c (time_mdump, time_mload): dump/load utc_offset.
...
[ruby-dev:40063]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-03 15:37:45 +00:00
nobu
572c266e05
* time.c (quo, time_mdump): use RRATIONAL().
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-03 15:29:15 +00:00
akr
85518db978
add comment.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-03 14:51:39 +00:00
akr
1d674dc547
* time.c (time_mload): add submicro into vtm.subsecx. [ruby-dev:40133]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-22 12:08:02 +00:00
akr
4bf4ddb693
* time.c (time_to_r): convert to rational if internal representation
...
is not rational.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-13 23:51:16 +00:00
akr
49ab7b4238
update rdoc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-13 19:49:39 +00:00
akr
d5a96ece85
* time.c (time_mdump): use nano_num and nano_den instead of subnano to
...
avoid Rational class in marshaled data which prevent unmarshal by
Ruby 1.8.
(time_mload): use nano_num and nano_den.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-13 19:04:17 +00:00
matz
2c2cf71b04
* time.c (num_exact): should not accept strings as operands, even
...
though they respond to #to_r. ideally, strict rational
conversion should be done by a method like #to_rational, not #to_r.
[ruby-core:23729]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-04 07:37:10 +00:00
nobu
4d786d21e3
* removed spaces just before tabs.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-26 05:25:08 +00:00
akr
b9e0294eda
fix typos.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03 17:46:28 +00:00
marcandre
705c567194
* string.c: rdoc for <=>, casecmp
...
* bignum.c: rdoc for <=>
* file.c: ditto
* time.c: ditto
* compar.c: rdoc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-28 04:50:09 +00:00
matz
9b192302ec
* time.c (rb_time_succ): make Time#succ obsolete since time is not
...
a discrete value.
* range.c (discrete_object_p): treat time objects specially to
determine discrete values, since time objects have #succ yet are
discrete (for now at least).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-30 08:32:43 +00:00
nobu
bb09904691
* time.c: fixed type.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-23 04:16:41 +00:00
akr
87105a7da4
* time.c (time_mdump): error message refined.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-16 15:36:30 +00:00
nobu
fe963a4510
* time.c (rb_time_timeval, rb_time_timespec): typed.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-09 04:06:37 +00:00
nobu
5c0a8e947a
* time.c (time_data_type): typed.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-09 03:43:48 +00:00
akr
44320bc32c
* time.c (find_time_t): use mktime for the first guess.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-30 14:44:54 +00:00
akr
dcf2aad3a5
* time.c (add): shortcut implemented for fixnums.
...
(sub): ditto.
(mul): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-30 04:01:42 +00:00
akr
570d8f55b2
* time.c (eq): apply RTEST.
...
(ne): ditto.
(add): avoid method dispatch for bignums.
(sub): ditto.
(mul): ditto.
(mod): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-30 01:26:56 +00:00
akr
8b32a1de29
* timev.h (TIME_SCALE): defined as 1000000000.
...
(struct vtm): subsec is replaced by subsecx.
subsec * TIME_SCALE == subsecx.
* time.c: avoid rational in most cases.
(struct time_object): timev is replaced by timexv.
timev * TIME_SCALE == timexv.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-29 19:06:29 +00:00
akr
4a9bca2496
* time.c (init_leap_second_info): use TIMET_MAX.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-29 18:18:37 +00:00
nobu
9f66faa374
* time.c (init_leap_second_info): checks the result of gmtime to
...
suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-22 15:09:50 +00:00
nobu
796fc30f84
* time.c (time_timespec): rounds subsecond toward zero.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-12 16:18:18 +00:00
akr
b5279bb551
* time.c (find_time_t): fix Time.local(2009,2,31) failure on 64bit
...
time_t environment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-05 15:11:27 +00:00
akr
7eb5c0ac74
* time.c (find_time_t): less number of guesses for hh:mm:60.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-03 13:49:41 +00:00
akr
4e195adda5
* time.c (find_time_t): time guess strategy refined again.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-02 17:53:21 +00:00
akr
e8f835a10e
suppress a warning.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-02 15:42:18 +00:00
akr
26f32868c7
* time.c (find_time_t): time guess strategy refined.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-02 15:37:06 +00:00
nobu
432768449d
* time.c (num_exact): rb_check_to_integer() can deal with both of
...
Fixnum and Bignum together.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-01 23:04:46 +00:00
akr
841cf3b948
* time.c (num_exact): use to_r for T_FLOAT.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-01 20:38:57 +00:00
akr
36b84733f4
* time.c (quo): return an integer if possible.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-01 20:17:00 +00:00
akr
2cb0c38014
unused variable removed.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-01 18:48:34 +00:00
akr
2f8b6234cd
* include/ruby/intern.h (rb_time_num_new): declared.
...
* time.c (nsec2timev): extracted from time_new_internal.
(time_new_internal): change argument to VALUE.
(rb_time_new): follow the argument change.
(rb_time_nano_new): ditto.
(rb_time_num_new): new function.
* ext/socket/ancdata.c (ancillary_timestamp): use rb_time_num_new to
represent struct bintime preciously.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-01 12:11:53 +00:00