What is a quadruple-precision integer package?

This is a discussion on What is a quadruple-precision integer package? within the C Programming forums, part of the General Programming Boards category; I'm working through An Introduction to ANSI C on UNIX which has suited me well so far. I don't understand ...

  1. #1
    Registered User Gerling's Avatar
    Join Date
    Aug 2010
    Posts
    4

    What is a quadruple-precision integer package?

    I'm working through An Introduction to ANSI C on UNIX which has suited me well so far.
    I don't understand this problem they gave me, though.
    "Write a quadruple-precision integer package with integer arrays and the arithmetic routines: qint_add, qint_sub, int_times, qint_quotient, and qint_display."
    I know pretty well about precision, I think, but why not use floats for only four decimal places? The only meaning I can think of for this problem has already been built into C.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    20,968
    Take a look at GMP, which is an arbitrary precision math library. It allows you to do calculations with number types such that the range of the results can go beyond the range of the built-in integer and floating point types. It seems to me that you are asking to implement an integer math library similiar to GMP's integer math facilities, except that it is limited to quadruple precision, not arbitrary precision. "Quadruple precision" itself probably just means that you are expected to make use of an array of four ints to store the value of your integer type.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User Gerling's Avatar
    Join Date
    Aug 2010
    Posts
    4
    The GMP looks very interesting. I'm glad you told me about it. I think I understand the exercise, now. It looks pretty challenging for me at this stage.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help assignment due tomorrow
    By wildiv in forum C Programming
    Replies: 6
    Last Post: 01-27-2010, 07:38 PM
  2. memory issue
    By t014y in forum C Programming
    Replies: 2
    Last Post: 02-20-2009, 11:37 PM
  3. Link List math
    By t014y in forum C Programming
    Replies: 17
    Last Post: 02-20-2009, 05:55 PM
  4. Looking for constructive criticism
    By wd_kendrick in forum C Programming
    Replies: 16
    Last Post: 05-28-2008, 09:42 AM
  5. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 09:43 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21