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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:10:06+00:00 2026-06-12T10:10:06+00:00

I read that gprof (function profiling) and other methods of profiling can return the

  • 0

I read that gprof (function profiling) and other methods of profiling can return the number of floating point operations taking place in the execution of a program and thus was wondering how Flops are so much more expensive than regular operations?

  • 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-12T10:10:07+00:00Added an answer on June 12, 2026 at 10:10 am

    I’m going to assume you’re talking about x86, but a lot of the below applies equally well to other architectures

    Floating point operations are expensive because operations on floating point numbers are much more expensive than operations on integers. It’s that simple. The format of integers makes addition and subtraction extremely simple to implement in hardware. Floating point numbers are (almost always) implemented in IEEE 754, which stores numbers as a sign, exponent, and mantissa, which allows for the representation of very large and very small numbers, but it comes at the cost of operation speed. If numbers only had 3 decimal places, you could use integers, and just divide by 3 at the end; the wide range of precision complicates things.

    That being said, modern processors are better with floating point numbers than they used to be. Floating-point math was originally implemented on an optional coprocessor – the Intel 80387 in particular – and it could only be accessed with special instructions. You’d push values onto the x87 stack, perform an operation, and then pop it back into a hardware register. Very slow, because it had to leave the processor. Even more importantly, those particular operations became “risky” to use because you couldn’t be sure the processor existed – if it didn’t, your program would work, but it would use software routines that emulated the coprocessor. If you were a game developer and you couldn’t rely on, say, inverse square root being fast, you could do the work yourself, and you’d run equally fast on all systems – not slightly faster on some, and much slower on others.

    Nowadays, processors have special floating point operations that are designed for performance, and more importantly, guaranteed to be there. So they’re very fast, and while floating point ops are unavoidably slower than integer ops, they’re not usually enough of a problem to do anything about it – especially at the expense of bugs and complexity. What’s more, this answer suggests that, in most cases, it’s a wash.

    In any case, performance is now good enough that the old adage kicks in – programmer time is more important than machine time, and you’ll definitely spend a lot more time on programming some fancy algorithm avoiding floating point numbers than you would by just using them.

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

Sidebar

Related Questions

I read that MySQL fulltext search can cause table locking . It means people
I read that one can use char for small integers. However, when I try,
I read that one can support query by humming by using MIDI files. Can
I read that each column of a table can be styled using <colgroup> and
I read that in PHP, you can view all the cookies by using print_r,
I read that SVG animatable properties like transform can be animated by CSS transitions.
I read that the builtin ensemble methods in sklearn use decision trees as the
I read that compiler can enforce dbc at compile time.. How does it do
I read that you can pass an array as a parameter to a method
I read that PHPUnit can be installed with pear or with composer. Because I'm

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.