1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

fixed an issue about mathn.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2006-06-21 12:30:58 +00:00
parent 44e53b1dea
commit 1b5d98f3aa
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Wed Jun 21 21:28:32 2006 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb (jd_to_commercial): now works fine even if in
mathn-ized context.
Wed Jun 21 17:32:31 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* signal.c (ruby_nativethread_signal, posix_nativethread_signal,

View file

@ -1,7 +1,7 @@
#
# date.rb - date and time library
#
# Author: Tadayoshi Funaba 1998-2005
# Author: Tadayoshi Funaba 1998-2006
#
# Documentation: William Webber <william@williamwebber.com>
#
@ -370,7 +370,7 @@ class Date
ns = ns?(jd, sg)
a = jd_to_civil(jd - 3, ns)[0]
y = if jd >= commercial_to_jd(a + 1, 1, 1, ns) then a + 1 else a end
w = 1 + (jd - commercial_to_jd(y, 1, 1, ns)) / 7
w = 1 + ((jd - commercial_to_jd(y, 1, 1, ns)) / 7).floor
d = (jd + 1) % 7
if d.zero? then d = 7 end
return y, w, d