[#39954] Fwd: [ruby-cvs:33451] Ruby:r26235 (trunk): * trace.h: new file. wraps tracing mechanisms. — SASADA Koichi <ko1@...>

 ささだです.

16 messages 2010/01/04
[#39957] Re: Fwd: [ruby-cvs:33451] Ruby:r26235 (trunk): * trace.h: new file. wraps tracing mechanisms. — Yugui <yugui@...> 2010/01/04

2010/1/4 SASADA Koichi <ko1@atdot.net>:

[#39959] Re: Fwd: [ruby-cvs:33451] Ruby:r26235 (trunk): * trace.h: new file. wraps tracing mechanisms. — SASADA Koichi <ko1@...> 2010/01/04

 ささだです.

[#39975] [Feature #2571] 文字列のハミング距離 — Kenta Murata <redmine@...>

Feature #2571: 文字列のハミング距離

14 messages 2010/01/07

[#39978] "require 'logge'" fails on ruby 1.8.7 from http://github.com/shyouhei/ruby — MOROHASHI Kyosuke <moronatural@...>

諸橋です。

7 messages 2010/01/07

[#40004] [Bug:trunk] require_relative depends on current directory — Yusuke ENDOH <mame@...>

遠藤です。

13 messages 2010/01/09

[#40074] [Bug #2603] NetBSD 5.0以降でpthreadの処理に由来する不具合 — Takahiro Kambe <redmine@...>

Bug #2603: NetBSD 5.0以降でpthreadの処理に由来する不具合

29 messages 2010/01/14
[#40086] Re: [Bug #2603] NetBSD 5.0以降でpthreadの処理に由来する不具合 — f-miura@... (MIURA, Fumiaki) 2010/01/14

NTTレゾナントの三浦です。不完全なpatchを書いてすみません。

[#40088] Re: [Bug #2603] NetBSD 5.0以降でpthreadの処理に由来する不具合 — Takahiro Kambe <taca@...> 2010/01/14

こんばんは。

[#40091] Re: [Bug #2603] NetBSD 5.0以降でpthreadの処理に由来する不具合 — KOSAKI Motohiro <kosaki.motohiro@...> 2010/01/15

kosakiです

[#40092] Re: [Bug #2603] NetBSD 5.0以降でpthreadの処理に由来する不具合 — Takahiro Kambe <taca@...> 2010/01/15

こんにちは。

[#40077] [Bug #2604] test_dsa_sign_verify() in test/openssl/test_ec.rb failes — Takahiro Kambe <redmine@...>

Bug #2604: test_dsa_sign_verify() in test/openssl/test_ec.rb failes

11 messages 2010/01/14

[#40153] [Bug:trunk] three bugs of Matrix::Scalar — Yusuke ENDOH <mame@...>

連投すみません。

19 messages 2010/01/25
[#40184] Re: [Bug:trunk] three bugs of Matrix::Scalar — keiju@... (石塚圭樹) 2010/01/27

けいじゅ@いしつかです.

[#40189] Re: [Bug:trunk] three bugs of Matrix::Scalar — Yusuke ENDOH <mame@...> 2010/01/27

遠藤です。

[#40191] Re: [Bug:trunk] three bugs of Matrix::Scalar — keiju@... (石塚圭樹) 2010/01/27

けいじゅ@いしつかです.

[#40224] Re: [Bug:trunk] three bugs of Matrix::Scalar — Yukihiro Matsumoto <matz@...> 2010/01/28

まつもと ゆきひろです

[#40162] [Bug #2658] rubyspec: Ruby character strings interpolates the return value of Object#inspect, without ivars, if Object#to_s does not return a String instance ERROR — Yusuke Endoh <redmine@...>

Bug #2658: rubyspec: Ruby character strings interpolates the return value of Object#inspect, without ivars, if Object#to_s does not return a String instance ERROR

8 messages 2010/01/26
[#40163] Re: [Bug #2658] rubyspec: Ruby character strings interpolates the return value of Object#inspect, without ivars, if Object#to_s does not return a String instance ERROR — Tanaka Akira <akr@...> 2010/01/26

2010年1月26日20:39 Yusuke Endoh <redmine@ruby-lang.org>:

[#40168] [Bug #2662] BigDecimal#ceil, etc. should not return Integer — Yusuke Endoh <redmine@...>

Bug #2662: BigDecimal#ceil, etc. should not return Integer

10 messages 2010/01/26

[#40200] [Feature #2673] the length for an enumerator generated by Array#permutation and Array#combination — Kenta Murata <redmine@...>

Feature #2673: the length for an enumerator generated by Array#permutation and Array#combination

14 messages 2010/01/28

[#40221] [Bug:trunk] rubyspec: SimpleDelegator when frozen creates a frozen clone ERROR — Yusuke ENDOH <mame@...>

まつもとさん、または lib/delegator.rb についてわかる誰か

13 messages 2010/01/28

[#40265] MonitorMixin::ConditionVariable#wait timeout — Tanaka Akira <akr@...>

手元の Ubuntu 9.10 の環境で Ruby 1.9.2 を make test-all すると

38 messages 2010/01/30
[#40326] Re: MonitorMixin::ConditionVariable#wait timeout — Shugo Maeda <shugo@...> 2010/02/05

前田です。

[#41155] Re: MonitorMixin::ConditionVariable#wait timeout — Yusuke ENDOH <mame@...> 2010/05/05

前田さん、akr さん

[#41157] Re: MonitorMixin::ConditionVariable#wait timeout — Tanaka Akira <akr@...> 2010/05/05

2010年5月5日9:32 Yusuke ENDOH <mame@tsg.ne.jp>:

[#41158] Re: MonitorMixin::ConditionVariable#wait timeout — Yusuke ENDOH <mame@...> 2010/05/05

遠藤です。

[#41159] Re: MonitorMixin::ConditionVariable#wait timeout — Tanaka Akira <akr@...> 2010/05/05

2010年5月5日11:46 Yusuke ENDOH <mame@tsg.ne.jp>:

[#41160] Re: MonitorMixin::ConditionVariable#wait timeout — Yusuke ENDOH <mame@...> 2010/05/05

遠藤です。

[#41182] Re: MonitorMixin::ConditionVariable#wait timeout — Tanaka Akira <akr@...> 2010/05/06

2010年5月5日13:22 Yusuke ENDOH <mame@tsg.ne.jp>:

[#41183] Re: MonitorMixin::ConditionVariable#wait timeout — Yusuke ENDOH <mame@...> 2010/05/06

遠藤です。

[#41186] Re: MonitorMixin::ConditionVariable#wait timeout — Tanaka Akira <akr@...> 2010/05/06

2010年5月6日19:58 Yusuke ENDOH <mame@tsg.ne.jp>:

[#41205] Re: MonitorMixin::ConditionVariable#wait timeout — Yusuke ENDOH <mame@...> 2010/05/06

遠藤です。

[#41207] Re: MonitorMixin::ConditionVariable#wait timeout — KOSAKI Motohiro <kosaki.motohiro@...> 2010/05/06

2010年5月6日23:08 Yusuke ENDOH <mame@tsg.ne.jp>:

[#41208] Re: MonitorMixin::ConditionVariable#wait timeout — Tanaka Akira <akr@...> 2010/05/06

2010年5月6日23:15 KOSAKI Motohiro <kosaki.motohiro@gmail.com>:

[#41245] Re: MonitorMixin::ConditionVariable#wait timeout — Yusuke ENDOH <mame@...> 2010/05/10

遠藤です。

[#41252] Re: MonitorMixin::ConditionVariable#wait timeout — KOSAKI Motohiro <kosaki.motohiro@...> 2010/05/10

kosakiです

[#41255] Re: MonitorMixin::ConditionVariable#wait timeout — Yusuke ENDOH <mame@...> 2010/05/10

遠藤です。

[#41256] Re: MonitorMixin::ConditionVariable#wait timeout — Masaya TARUI <tarui@...> 2010/05/10

樽家です。

[#40269] [Feature #2695] Supported Platforms — Kazuhiro NISHIYAMA <redmine@...>

Feature #2695: Supported Platforms

17 messages 2010/01/31
[#40760] [Feature #2695] Supported Platforms — Yusuke Endoh <redmine@...> 2010/03/25

チケット #2695 が更新されました。 (by Yusuke Endoh)

[ruby-dev:40083] BigMath の sin(BigDecimal("1E50"), 1) が無限ループ

From: TOYOFUKU Chikanobu <nobu_toyofuku@...>
Date: 2010-01-14 08:54:01 UTC
List: ruby-dev #40083
  豊福です。

  BigDecimal BigMath の sin(BigDecimal("1E50"), 1) が PI に
要求する精度の不足で無限ループになります。
ささやかな最適化も入れました。
テストプログラムも付けておきます。

--- /ext/bigdecimal/lib/bigdecimal/math.rb      (revision 25184)
+++ /ext/bigdecimal/lib/bigdecimal/math.rb      (working copy)
@@ -54,5 +54,6 @@
     two  = BigDecimal("2")
     x = -x if neg = x < 0
-    if x > (twopi = two * BigMath.PI(prec))
+    if x >= 6.3
+      twopi = two * PI(x.exponent+prec+1)
       if x > 30
         x %= twopi
@@ -62,6 +63,5 @@
     end
     x1   = x
-    x2   = x.mult(x,n)
-    sign = 1
+    x2   = -x.mult(x,n)
     y    = x
     d    = y
@@ -70,9 +70,8 @@
     while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0)
       m = BigDecimal.double_fig if m < BigDecimal.double_fig
-      sign = -sign
       x1  = x2.mult(x1,n)
       i  += two
       z  *= (i-one) * i
-      d   = sign * x1.div(z,m)
+      d   = x1.div(z,m)
       y  += d
     end
@@ -90,5 +89,6 @@
     two  = BigDecimal("2")
     x = -x if x < 0
-    if x > (twopi = two * BigMath.PI(prec))
+    if x >= 6.3
+      twopi = two * PI(x.exponent+prec+1)
       if x > 30
         x %= twopi
@@ -98,6 +98,5 @@
     end
     x1 = one
-    x2 = x.mult(x,n)
-    sign = 1
+    x2 = -x.mult(x,n)
     y = one
     d = y
@@ -106,9 +105,8 @@
     while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0)
       m = BigDecimal.double_fig if m < BigDecimal.double_fig
-      sign = -sign
       x1  = x2.mult(x1,n)
       i  += two
       z  *= (i-one) * i
-      d   = sign * x1.div(z,m)
+      d   = x1.div(z,m)
       y  += d
     end

======== テスト ========

require 'bigdecimal'
require 'bigdecimal/math'
include BigMath

# sin test
[
  ["1", ".8414709848078965066525023216302989996225630607983710656727517099919104043912396689486397435430526958"],
  ["-1", "-.8414709848078965066525023216302989996225630607983710656727517099919104043912396689486397435430526958"],
  ["1.5707963", ".9999999999999996410167575823529650844152981034590074856559180469605393157919430532545927996479289687"], # PI/2
  ["6.2", "-.08308940281749657800057928909836718528109967293845540803530361987239105120353659681491938223261595192"],
  ["10", "-.5440211108893698134047476618513772816836430129162238915741840126167572096404934257070756738949832161"],

  ["100", "-.5063656411097587936565576104597854320650327212906573234433924735943579134194766964992366645129273922"],
].each {|sx,sy|
  m = sy.gsub(/^-?0*\.?0*|E.*|\./,'').size
  x = BigDecimal(sx)
  y = BigDecimal(sy)
  n = y == 0 ? 1: y.exponent
  yeps = BigDecimal("1E#{n-m}")
  (1..m).each {|i|
    if (sin(x, i) - y).abs >= BigDecimal("1E#{n-i}") + yeps
      print "sin fail i: #{i}, x: #{x}\n"
      print sin(x, i), "\n"
      print y, "\n"
      break
    end
  }
}

# cos test
[
  ["1", ".5403023058681397174009366074429766037323104206179222276700972553811003947744717645179518560871830893"],
  ["-1", ".5403023058681397174009366074429766037323104206179222276700972553811003947744717645179518560871830893"],
  ["3.1415926", "-.9999999999999985640670303294121180755978657881108015358856694424326400998221703599107746795702773875"], # PI
  ["6.2", ".9965420970232174751394026238692639525278846240987172016105014589865551509745000082886442339885138615"],
  ["10", "-.8390715290764524522588639478240648345199301651331685468359537310487925868662707684009337127604221389"],
  ["100", ".8623188722876839341019385139508425355100840085355108292801621126927210880509266241030951056842772850"],
].each {|sx,sy|
  m = sy.gsub(/^-?0*\.?0*|E.*|\./,'').size
  x = BigDecimal(sx)
  y = BigDecimal(sy)
  n = y == 0 ? 1: y.exponent
  yeps = BigDecimal("1E#{n-m}")
  (1..m).each {|i|
    if (cos(x, i) - y).abs >= BigDecimal("1E#{n-i}") + yeps
      print "cos fail i: #{i}, x: #{x}\n"
      print cos(x, i), "\n"
      print y, "\n"
      break
    end
  }
}
---
May Haskell be with you.


In This Thread