Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 282727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:18:48+00:00 2026-05-12T05:18:48+00:00

I am seeing very, VERY strange behavior when I run certain reports: >> p

  • 0

I am seeing very, VERY strange behavior when I run certain reports:

>> p = BigDecimal.new('0.1785990254E5')
=> #<BigDecimal:b649b978,'0.1785990254E5',16(16)>
>> q = BigDecimal.new('0.76149149E4')
=> #<BigDecimal:b64968d8,'0.76149149E4',8(16)>
>> p-q
=> #<BigDecimal:b6495ab4,'0.124498764E5',16(32)>
>> p.to_s
=> "17859.90254"
>> q.to_s
=> "7614.9149"
>> (p-q).to_s
=> "10244.98764"

If you notice, p.to_s and the BigDecimal’s representation look consistent. Same with q and q.to_s. However, p-q has the string represented as ‘0.1244…’ but comes out when formatted as “10244.98…”

When I run this through number_to_currency it actually displays the wrong number ($12,449.88) rather than the expected number, but ONLY on my RHEL 4 Box.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:18:48+00:00Added an answer on May 12, 2026 at 5:18 am

    After looking at the versions, it appears I am running Ruby 1.8.5 on the RHEL box and Ruby 1.8.6 on my local box. I assume this would account for the problems? Strange problems indeed.

    Update:
    Confirmed – Upgrade to 1.8.6 resolved the issues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm seeing a very strange issue with a .NET webservice being consumed by Flex.
I'm seeing a very strange error when trying to use ViewPagerIndicator (http://viewpagerindicator.com/). I've narrowed
With a very simple Mockito run JUnit test and class I am seeing different
I'm seeing some very strange behaviour from the Apple Push Notification Servers when the
I am seeing a very strange problem on one of my production boxes. We
So I am seeing some very strange functionality in my app. I have a
I am seeing very strange behaviour, with DateTime choosing to add a day sometimes,
I'm working with javascript Date objects and seeing very odd behavior. If I keep
I am seeing something very strange when using embedded <style> tags inside HTML email
I am seeing a very strange issue with a simple controller method. Either I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.