From 274ae70db28a10ef2c25c65b595d0e3820a22229 Mon Sep 17 00:00:00 2001 From: tadf Date: Wed, 21 Jun 2006 12:23:58 +0000 Subject: fixed an issue about mathn. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/date.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/date.rb b/lib/date.rb index 93419091ae..722ecd154e 100644 --- a/lib/date.rb +++ b/lib/date.rb @@ -1,7 +1,7 @@ # # date.rb - date and time library # -# Author: Tadayoshi Funaba 1998-2005 +# Author: Tadayoshi Funaba 1998-2006 # # Documentation: William Webber # @@ -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 -- cgit v1.2.3