# Something broke ruby floats

**URL:** <https://rubytalk.org/t/something-broke-ruby-floats/56408>\
**Category:** ruby-talk\
**Created:** [28 November 2009 17:38 UTC](https://rubytalk.org/t/something-broke-ruby-floats/56408 "2009-11-28T17:38:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joel\_VanderWerf1](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@Joel\_VanderWerf1](https://rubytalk.org/u/Joel_VanderWerf1)\
**Post date:** [28 November 2009 17:38 UTC](https://rubytalk.org/t/something-broke-ruby-floats/56408/1 "2009-11-28T17:38:06Z")

</div>

Noticed this after rebuilding ruby (with configure args --disable-pthread --enable-shared):

~/src/ruby\> RUBYOPT='' ./ruby -e 'x=0.123; puts x'  
123.0  
~/src/ruby\> ldd ./ruby  
&nbsp;&nbsp;linux-gate.so.1 =\> (0x00b0e000)  
&nbsp;&nbsp;libruby.so.1.8 =\> /usr/local/lib/libruby.so.1.8 (0x00236000)  
&nbsp;&nbsp;libdl.so.2 =\> /lib/tls/i686/cmov/libdl.so.2 (0x00132000)  
&nbsp;&nbsp;libcrypt.so.1 =\> /lib/tls/i686/cmov/libcrypt.so.1 (0x007b8000)  
&nbsp;&nbsp;libm.so.6 =\> /lib/tls/i686/cmov/libm.so.6 (0x00d63000)  
&nbsp;&nbsp;libc.so.6 =\> /lib/tls/i686/cmov/libc.so.6 (0x00394000)  
&nbsp;&nbsp;/lib/ld-linux.so.2 (0x0067e000)  
~/src/ruby\> ./ruby -v  
ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux]

(same after make install)

Any ideas what broke? I've never seen anything like this before, and I've been using p287 on several systems for months (at least). This is on ubuntu karmic.

Further info:

~/src/ruby\> make check  
not ok float 1 -- ./sample/test.rb:1172  
not ok float 2 -- ./sample/test.rb:1173  
not ok float 3 -- ./sample/test.rb:1174  
not ok float 4 -- ./sample/test.rb:1175  
not ok float 5 -- ./sample/test.rb:1176  
not ok float 6 -- ./sample/test.rb:1177  
not ok float 7 -- ./sample/test.rb:1178  
not ok float 8 -- ./sample/test.rb:1179  
not ok float 9 -- ./sample/test.rb:1180  
test failed  
make: \*\*\* [test] Error 1

> **···**
>
> --  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

---

<div class="post-metadata">

**Author:** ![Ryan\_Davis1](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/ryan_davis1/32/1848_2.png) [@Ryan\_Davis1](https://rubytalk.org/u/Ryan_Davis1)\
**Post date:** [28 November 2009 22:14 UTC](https://rubytalk.org/t/something-broke-ruby-floats/56408/2 "2009-11-28T22:14:51Z")

</div>

CC'ing ruby-core@

> **···**
>
> On Nov 28, 2009, at 09:38 , Joel VanderWerf wrote:
> 
> > Noticed this after rebuilding ruby (with configure args --disable-pthread --enable-shared):
> > 
> > ~/src/ruby\> RUBYOPT='' ./ruby -e 'x=0.123; puts x'  
> > 123.0  
> > ~/src/ruby\> ldd ./ruby  
> > &nbsp;&nbsp;linux-gate.so.1 =\> (0x00b0e000)  
> > &nbsp;&nbsp;libruby.so.1.8 =\> /usr/local/lib/libruby.so.1.8 (0x00236000)  
> > &nbsp;&nbsp;libdl.so.2 =\> /lib/tls/i686/cmov/libdl.so.2 (0x00132000)  
> > &nbsp;&nbsp;libcrypt.so.1 =\> /lib/tls/i686/cmov/libcrypt.so.1 (0x007b8000)  
> > &nbsp;&nbsp;libm.so.6 =\> /lib/tls/i686/cmov/libm.so.6 (0x00d63000)  
> > &nbsp;&nbsp;libc.so.6 =\> /lib/tls/i686/cmov/libc.so.6 (0x00394000)  
> > &nbsp;&nbsp;/lib/ld-linux.so.2 (0x0067e000)  
> > ~/src/ruby\> ./ruby -v  
> > ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux]
> > 
> > (same after make install)
> > 
> > Any ideas what broke? I've never seen anything like this before, and I've been using p287 on several systems for months (at least). This is on ubuntu karmic.
> > 
> > Further info:
> > 
> > ~/src/ruby\> make check  
> > not ok float 1 -- ./sample/test.rb:1172  
> > not ok float 2 -- ./sample/test.rb:1173  
> > not ok float 3 -- ./sample/test.rb:1174  
> > not ok float 4 -- ./sample/test.rb:1175  
> > not ok float 5 -- ./sample/test.rb:1176  
> > not ok float 6 -- ./sample/test.rb:1177  
> > not ok float 7 -- ./sample/test.rb:1178  
> > not ok float 8 -- ./sample/test.rb:1179  
> > not ok float 9 -- ./sample/test.rb:1180  
> > test failed  
> > make: \*\*\* [test] Error 1
> > 
> > --  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

---

<div class="post-metadata">

**Author:** ![Joel\_VanderWerf1](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@Joel\_VanderWerf1](https://rubytalk.org/u/Joel_VanderWerf1)\
**Post date:** [29 November 2009 07:03 UTC](https://rubytalk.org/t/something-broke-ruby-floats/56408/3 "2009-11-29T07:03:47Z")

</div>

Ryan Davis wrote:

> CC'ing ruby-core@

Thanks.

Brief update: building with gcc-4.3 seems to fix the issue, and `make check` passes, except for one test in SOAP.

> **···**
>
> --  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
