Forum: Ruby-core [ruby-trunk - Bug #6784][Open] Test failures related to numeric with x64 mingw

Posted by h.shirosaki (Hiroshi Shirosaki) (Guest)
on 2012-07-24 00:26
(Received via mailing list)
Issue #6784 has been reported by h.shirosaki (Hiroshi Shirosaki).

----------------------------------------
Bug #6784: Test failures related to numeric with x64 mingw
https://bugs.ruby-lang.org/issues/6784

Author: h.shirosaki (Hiroshi Shirosaki)
Status: Open
Priority: Normal
Assignee: luislavena (Luis Lavena)
Category:
Target version:
ruby -v: ruby 2.0.0dev (2012-07-23 trunk 36499) [x64-mingw32]


x64 mingw build has many floating point numeric related failures in 
test-all.

http://ci.rubyinstaller.org/job/test-ruby-trunk-x6...

  2) Failure:
test_plus(TestBignum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_bignum.rb:244]:
<2535301200456458802993406410752> expected but was
<2.535301200456461e+30>.

  3) Failure:
test_sub(TestBignum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_bignum.rb:232]:
<0> expected but was
<-2.251799813685248e+15>.

  6) Failure:
test_divide(TestFixnum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_fixnum.rb:156]:
<2.328306436538698e-10> expected but was
<(1/4294967296)>.

  7) Failure:
test_pow2(TestFixnum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_fixnum.rb:184]:
<1.5258789062500007e-05> expected but was
<(1/65536)>.

  8) Failure:
test_divmod2(TestFloat) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_float.rb:269]:
<4294967296> expected but was
<4294967295>.

  9) Failure:
test_round_with_precision(TestFloat) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_float.rb:382]:
<1.1> expected but was
<1.0999999999999999>.



This seems cause of broken pow() implementation of x64 mingw.
Using powl() instead of pow() will fix this. I attached the patch.

I tested it with gcc version 4.6.1 (tdm64-1) on Win7.
Posted by Luis Lavena (luislavena)
on 2012-07-24 01:13
(Received via mailing list)
Issue #6784 has been updated by luislavena (Luis Lavena).

Category set to core
Status changed from Open to Assigned
Assignee changed from luislavena (Luis Lavena) to nobu (Nobuyoshi 
Nakada)
Target version set to 2.0.0

Thank you Hiroshi,

I'm reassigning this ticket to Nobu looking for approval.

CC: Usa, do you agree with Hiroshi conclusion and solution? If so, I 
will commit.

Thank you.

----------------------------------------
Bug #6784: Test failures related to numeric with x64 mingw
https://bugs.ruby-lang.org/issues/6784#change-28358

Author: h.shirosaki (Hiroshi Shirosaki)
Status: Assigned
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-07-23 trunk 36499) [x64-mingw32]


x64 mingw build has many floating point numeric related failures in 
test-all.

http://ci.rubyinstaller.org/job/test-ruby-trunk-x6...

  2) Failure:
test_plus(TestBignum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_bignum.rb:244]:
<2535301200456458802993406410752> expected but was
<2.535301200456461e+30>.

  3) Failure:
test_sub(TestBignum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_bignum.rb:232]:
<0> expected but was
<-2.251799813685248e+15>.

  6) Failure:
test_divide(TestFixnum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_fixnum.rb:156]:
<2.328306436538698e-10> expected but was
<(1/4294967296)>.

  7) Failure:
test_pow2(TestFixnum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_fixnum.rb:184]:
<1.5258789062500007e-05> expected but was
<(1/65536)>.

  8) Failure:
test_divmod2(TestFloat) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_float.rb:269]:
<4294967296> expected but was
<4294967295>.

  9) Failure:
test_round_with_precision(TestFloat) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_float.rb:382]:
<1.1> expected but was
<1.0999999999999999>.



This seems cause of broken pow() implementation of x64 mingw.
Using powl() instead of pow() will fix this. I attached the patch.

I tested it with gcc version 4.6.1 (tdm64-1) on Win7.
Posted by U.Nakamura (Guest)
on 2012-07-24 02:34
(Received via mailing list)
Hello,

In message "[ruby-core:46690] [ruby-trunk - Bug #6784][Assigned] Test 
failures related to numeric with x64 mingw"
    on Jul.24,2012 08:13:27, <luislavena@gmail.com> wrote:
> CC: Usa, do you agree with Hiroshi conclusion and solution? If so, I will 
commit.

I have not set up the 64bit mingw environment yet.
Therefore, I have not checked this.
However, probably, it will be the problem of mingw, since it
has not occurred in mswin.

About Hiroshi's patch, I don't think the name "fake_pow" is
a good name.
We should use "rb_w32_" prefix for the published name.
I think the patch is OK except it.




Regards,
Posted by Luis Lavena (luislavena)
on 2012-07-24 02:53
(Received via mailing list)
Issue #6784 has been updated by luislavena (Luis Lavena).

Assignee changed from nobu (Nobuyoshi Nakada) to h.shirosaki (Hiroshi 
Shirosaki)

=begin
Thank you Usa,

Hiroshi, see comments from Usa at [ruby-core:46694]:

 About Hiroshi's patch, I don't think the name "fake_pow" is
 a good name.
 We should use "rb_w32_" prefix for the published name.
 I think the patch is OK except it.

Please commit variant following those suggestions (e.g. rb_w32_pow)
=end
----------------------------------------
Bug #6784: Test failures related to numeric with x64 mingw
https://bugs.ruby-lang.org/issues/6784#change-28365

Author: h.shirosaki (Hiroshi Shirosaki)
Status: Assigned
Priority: Normal
Assignee: h.shirosaki (Hiroshi Shirosaki)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-07-23 trunk 36499) [x64-mingw32]


x64 mingw build has many floating point numeric related failures in 
test-all.

http://ci.rubyinstaller.org/job/test-ruby-trunk-x6...

  2) Failure:
test_plus(TestBignum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_bignum.rb:244]:
<2535301200456458802993406410752> expected but was
<2.535301200456461e+30>.

  3) Failure:
test_sub(TestBignum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_bignum.rb:232]:
<0> expected but was
<-2.251799813685248e+15>.

  6) Failure:
test_divide(TestFixnum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_fixnum.rb:156]:
<2.328306436538698e-10> expected but was
<(1/4294967296)>.

  7) Failure:
test_pow2(TestFixnum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_fixnum.rb:184]:
<1.5258789062500007e-05> expected but was
<(1/65536)>.

  8) Failure:
test_divmod2(TestFloat) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_float.rb:269]:
<4294967296> expected but was
<4294967295>.

  9) Failure:
test_round_with_precision(TestFloat) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_float.rb:382]:
<1.1> expected but was
<1.0999999999999999>.



This seems cause of broken pow() implementation of x64 mingw.
Using powl() instead of pow() will fix this. I attached the patch.

I tested it with gcc version 4.6.1 (tdm64-1) on Win7.
Posted by lancel (lancel lancel) (Guest)
on 2012-11-22 02:47
(Received via mailing list)
Issue #6784 has been updated by lancel (lancel lancel).


=begin
All of us have read the stories of excite people's 
((<lancel|URL:http://www.lancel1.com/>))  mind, the hero of the story to 
live only for a very limited time, sometimes up to a year, sometimes as 
short as one day. But we always want to know, the doomed choose how to 
spend their ((<sac lancel|URL:http://www.lancel1.com/>)) last days. Of 
course, I say is of free men who have a choice, not whose sphere of 
activities is strictly.458gyu854
=end

----------------------------------------
Bug #6784: Test failures related to numeric with x64 mingw
https://bugs.ruby-lang.org/issues/6784#change-33425

Author: h.shirosaki (Hiroshi Shirosaki)
Status: Closed
Priority: Normal
Assignee: h.shirosaki (Hiroshi Shirosaki)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-07-23 trunk 36499) [x64-mingw32]


x64 mingw build has many floating point numeric related failures in 
test-all.

http://ci.rubyinstaller.org/job/test-ruby-trunk-x6...

  2) Failure:
test_plus(TestBignum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_bignum.rb:244]:
<2535301200456458802993406410752> expected but was
<2.535301200456461e+30>.

  3) Failure:
test_sub(TestBignum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_bignum.rb:232]:
<0> expected but was
<-2.251799813685248e+15>.

  6) Failure:
test_divide(TestFixnum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_fixnum.rb:156]:
<2.328306436538698e-10> expected but was
<(1/4294967296)>.

  7) Failure:
test_pow2(TestFixnum) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_fixnum.rb:184]:
<1.5258789062500007e-05> expected but was
<(1/65536)>.

  8) Failure:
test_divmod2(TestFloat) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_float.rb:269]:
<4294967296> expected but was
<4294967295>.

  9) Failure:
test_round_with_precision(TestFloat) 
[C:/Users/Worker/Jenkins/workspace/git-ruby-trunk/test/ruby/test_float.rb:382]:
<1.1> expected but was
<1.0999999999999999>.



This seems cause of broken pow() implementation of x64 mingw.
Using powl() instead of pow() will fix this. I attached the patch.

I tested it with gcc version 4.6.1 (tdm64-1) on Win7.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.