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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:27:17+00:00 2026-06-12T14:27:17+00:00

I am programming a numerical analysis program and sometimes the calculus give in some

  • 0

I am programming a numerical analysis program and sometimes the calculus give in some of the coefficients really small numbers i.e a0=1.234542e-12

If I calculate an array of 10 values (from which i.e. 6 of them are small numbers) and later on I multiply each of them by t^x (just as an example)
being x=1:10, what is faster computationally?

  • just leave the small number as they are
  • Detect numbers that are lower than threshold and substitute them by 0.0

The question is mainly because maybe the compiler just doesn’t make the calculus of a number multiplied by 0 because it always is 0, or it may just multiply it and I am making the program slower for adding if conditionals just to check if a number is 0 or not.

  • 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-12T14:27:19+00:00Added an answer on June 12, 2026 at 2:27 pm

    If you are asking, as you seem to be, which is the faster of these 2 operations:

    1. Multiplying a vector of numbers including some which are close to 0.0.
    2. Running through a vector of numbers setting to 0.0 those which are close to 0.0 and then multiplying the vector.

    well, I think that in the limit 1 will be faster than 2.

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

Sidebar

Related Questions

I am totally new to math/numerical analysis programming and I was looking all over
This is more of a numerical analysis rather than programming question, but I suppose
Lately I have been doing some numerical method programming in C. For the bug
Programming for my Arduino (in some kind of mix of C/C++), I noticed something
My programming background comes from C and some C++ programming with strong emphasis on
I am currently programming in C++ and C#. Using native C++ for the numerical
I have three kind of numerical ranges which are defined within some interval like:
I have written a small piece of code to calculate quadratic equations, but if
This really isn't programming per se, but is related to Visual Studio.. Anytime I
I’m looking for a good numerical computing library for C programming language. Similar to

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.