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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:41:17+00:00 2026-05-12T08:41:17+00:00

This is in reference to C++ and using the Visual Studio compilers. Is there

  • 0

This is in reference to C++ and using the Visual Studio compilers.

Is there any difference in speed when reading/writing (to RAM) and doing mathematical operations on different types of variables such as bool, short int, int, float, and doubles?

From what I understand so far, mathematical operations with doubles takes much longer (I am talking about 32 bit processors, I know little about 64 bit processors) than, say, operations with floats.

How then do operations (reading/writing to ram and elementary math) with float and int compare? How about int and short int, or even differences between signed and unsigned versions of each of the types? Is there any one data type that would be most efficient to work with as low number counters?

Thanks,
-Faken

  • 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-12T08:41:17+00:00Added an answer on May 12, 2026 at 8:41 am

    There are two different questions here: speed when reading/writing, and arithmetic performance. Those are orthogonal. When reading or writing a large array, of course, the speed depends on the amount of bytes read as O(N), so using short over int (considering VC++) would slash the time by ~1/2.

    For arithmetic, once the operands are in registers, the size of the type doesn’t matter so much. IIRC, between types in the same category, it is actually the same (so short isn’t any faster or slower than int). Using 64-bit integer types on a 32-bit platform will have a penalty, naturally, since there’s no single instruction to handle that. Floating-point types, on the other hand, are simply slower than all integral types, even though sizeof(float)==sizeof(int) on VC++. But, again, operations on float aren’t any faster than operations on double; this is assuming default FPU settings, which promote all operands to 80-bit extended floats – this can be disabled to squeeze out a bit more out of using floats, IIRC.

    The above is VC++ and x86 specific, as requested by the question. Other platform, and especially other architecture, can differ radically.

    The best one data type that is most efficient to work with as number counter (low or not) is int – usually regardless of the architecture and implementation (as the Standard recommends it to be the preferred word size of the platform).

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

Sidebar

Ask A Question

Stats

  • Questions 214k
  • Answers 214k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Laura you were right I had to add the equals… May 12, 2026 at 10:48 pm
  • Editorial Team
    Editorial Team added an answer Most good antivirus heuristics should pick up on import table… May 12, 2026 at 10:48 pm
  • Editorial Team
    Editorial Team added an answer Unfortunately there is no one great MVVM example app that… May 12, 2026 at 10:48 pm

Related Questions

I have the following problem: My (C++-)project consists of several subprojects. In each, I
I am working with VCCodeModel in both C# and C++ CLR and I am
Is there some sort of Learning C for developers of other languages book or
For our VB.NET websites we use SVN for Source Control and CruiseControl.NET for continuous

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.