Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C++ question

C++ question

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cpudood
    wrote on last edited by
    #1

    // This program is a test to verify whether or not the theory illustrated // in Digital Fundamentals pg60 of 32 bit binary number recognition, is // applicable with regards to an AMD 1.4 Ghz processor. #include #include #include using namespace std; int mantissa; int max_integer=0; int temp=0; int main() { mantissa = 30; while(mantissa!= -1) { temp = pow(2,mantissa); max_integer = max_integer + temp; --mantissa; } cout<

    J 1 Reply Last reply
    0
    • C Cpudood

      // This program is a test to verify whether or not the theory illustrated // in Digital Fundamentals pg60 of 32 bit binary number recognition, is // applicable with regards to an AMD 1.4 Ghz processor. #include #include #include using namespace std; int mantissa; int max_integer=0; int temp=0; int main() { mantissa = 30; while(mantissa!= -1) { temp = pow(2,mantissa); max_integer = max_integer + temp; --mantissa; } cout<

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      // So if the maximum integer possible on this machine uses 31 bits, and this is a 32 bit // processor, what is the other bit used for? For the sign. Compare this with unsigned ints, which, as they do not store any sign, can be twice as large (plus one) as the maximum int. PS: I don't really understand the code, though, looks interesting, will have a look at it. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups