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 9214013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:52:52+00:00 2026-06-18T01:52:52+00:00

Does R have a known problem with uniroot and handling floating points? >str(uniroot(function(x) x*(x^2-1)

  • 0

Does R have a known problem with uniroot and handling floating points?

>str(uniroot(function(x) x*(x^2-1) + .5, lower = -2, upper = 2,
+                  tol = 0.0001))

List of 4
$ root      : num -1.19
$ f.root    : num -2.55e-07
$ iter      : int 7
$ estim.prec: num 5e-05
> -1.19 * ( 1.19 ^ 2 - 1 ) + 0.5 
[1] 0.004841

Clearly the value of f.root is not equal to the value of the function calculated by hand.

  • 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-18T01:52:53+00:00Added an answer on June 18, 2026 at 1:52 am

    Your value of root is shown to only 2 s.f., but it estimates the precision at 5e-5. That suggests it “knows” other digits in the answer that you are not looking at. Try to print out root-1.19 and you will see what I mean.

    In particular, str is intended as a quick way to view the structure of an R object, so it intentionally prints a limited number of digits: the default value of digits.d is 3 (see ?str). Just printing the results (as in uniroot(...) or u1 <- uniroot(...); u1 would have shown you more digits and perhaps have avoided the confusion.

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

Sidebar

Related Questions

I am sure you have already heard about this problem. Given a list of
I have a question about NSFetchedResultController updating problem. As you may have already known,
General Problem I have some objects that have some variables that are not known
Does anybody have or know of a TextWriter for the Console that understand how
Does anyone have any ideas or know of any plugins to allow pages to
I know that SQL Server does not have boolean data type and your best
I know that an interface does not have a body, just a method definition.
Does anyone have any advice how to write such app? Or maybe knows some
Anyone know why CSS provides color for text, but does not have font-color or
I know this is kind of a dumb question, but does anyone have an

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.