Skip to content

Commit

Permalink
Remove mentions of Bignum in time.c
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
jeremyevans committed Feb 19, 2021
1 parent 8743732 commit b51e5c2
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions time.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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_,
Expand All @@ -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.
Expand Down

0 comments on commit b51e5c2

Please sign in to comment.