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

  • Home
  • SEARCH
  • 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 8624093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:26:24+00:00 2026-06-12T07:26:24+00:00

Just got a FloatDomainError in my app, with the message NaN where the server

  • 0

Just got a “FloatDomainError” in my app, with the message “NaN” where the server would ordinarily describe the offense. The server error page points me to these lines (well, the first one):

n = ((self.weight * (c.percent)/100) / c.package_weight).to_i
n.times do 

The problem seems to be with the .to_i, which is meant to convert what totals to 8.35 into an integer so I can do n.times do.

The problem is, if I take to_i away, I get an error telling me, logically enough, that there’s no method “times” for the float 8.35. But I don’t get why it’s not letting me round off 8.35 to an integer. I’ve tried .floor too, but I get the FloatDomainError.

Ideas on how to round this off so I can get it to work?

Thanks!

  • 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-06-12T07:26:25+00:00Added an answer on June 12, 2026 at 7:26 am

    This error means that you tried to convert a NaN value to int. NaN stands for “Not a number”. That probably meants that your calculation is flawed and not result in 8.35. Maybe the value of c.package_weight is zero and you divide with it.

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

Sidebar

Related Questions

I just got setup on my first Windows Server 2008 / IIS7.5 server for
I just got the following type error while executing my Python script: File /Library/Python/2.7/site-packages/Flask-0.9-py2.7.egg/flask/app.py,
I just got a crash report (at launch), after submitting my app to the
I just got asked to reduce the traffic made by my GWT app. There
Just got a huge (multi-hundred page) Classic ASP site. Is there an easy -
I just got an old pentium 4 and I thought, that it would be
Just got this message today on user machines when pushing out an update to
I just got Scott Hanselman's chat app with SignalR working with ASP.NET MVC 4.
I just got my first app up and running on Node.js. As of now,
I just got this error when trying to use a function parameter for a

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.