зеркало из https://github.com/github/ruby.git
Remove mentions of Bignum in time.c
Move section on internal details out of the class-level documentation, since users do not need to know that. Update it to use Integer(T_BIGNUM) instead of Bignum. Fixes [Misc #17580]
This commit is contained in:
Родитель
8743732621
Коммит
b51e5c2370
19
time.c
19
time.c
|
@ -5080,7 +5080,7 @@ time_mdump(VALUE time)
|
|||
* Append extended year distance from 1900..(1900+0xffff). In
|
||||
* each cases, there is no sign as the value is positive. The
|
||||
* format is length (marshaled long) + little endian packed
|
||||
* binary (like as Fixnum and Bignum).
|
||||
* binary (like as Integer).
|
||||
*/
|
||||
size_t ysize = rb_absint_size(year_extend, NULL);
|
||||
char *p, *const buf_year_extend = buf + base_dump_size;
|
||||
|
@ -5589,6 +5589,16 @@ rb_time_zone_abbreviation(VALUE zone, VALUE time)
|
|||
return rb_obj_as_string(abbr);
|
||||
}
|
||||
|
||||
/* Internal Details:
|
||||
*
|
||||
* Since Ruby 1.9.2, Time implementation uses a signed 63 bit integer or
|
||||
* Integer(T_BIGNUM), Rational.
|
||||
* The integer is a number of nanoseconds since the _Epoch_ which can
|
||||
* represent 1823-11-12 to 2116-02-20.
|
||||
* When Integer(T_BIGNUM) or Rational is used (before 1823, after 2116, under
|
||||
* nanosecond), Time works slower than when integer is used.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Time is an abstraction of dates and times. Time is stored internally as
|
||||
* the number of seconds with subsecond since the _Epoch_,
|
||||
|
@ -5605,13 +5615,6 @@ rb_time_zone_abbreviation(VALUE zone, VALUE time)
|
|||
* (Since Ruby 2.7.0, Time#inspect shows subsecond but
|
||||
* Time#to_s still doesn't show subsecond.)
|
||||
*
|
||||
* Since Ruby 1.9.2, Time implementation uses a signed 63 bit integer,
|
||||
* Bignum or Rational.
|
||||
* The integer is a number of nanoseconds since the _Epoch_ which can
|
||||
* represent 1823-11-12 to 2116-02-20.
|
||||
* When Bignum or Rational is used (before 1823, after 2116, under
|
||||
* nanosecond), Time works slower as when integer is used.
|
||||
*
|
||||
* = Examples
|
||||
*
|
||||
* All of these examples were done using the EST timezone which is GMT-5.
|
||||
|
|
Загрузка…
Ссылка в новой задаче