math programming

This is a discussion on math programming within the C Programming forums, part of the General Programming Boards category; I am trying to make a program that will find the sqaure root of any number. I have ing a ...

  1. #1
    Unregistered
    Guest

    Question math programming

    I am trying to make a program that will
    find the sqaure root of any number. I have
    ing a lot of trouble. Maybe it would help if
    someone could show me the derivation
    of the sqarue root mathematicaly.

    please help,
    Alizeirn

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    552

  3. #3
    Unregistered
    Guest
    still, im trying to find a way to extract an exact square root.
    unless the only way is to use limits and see what number the
    answer is closing in on, but then I would really be lost as far
    as programming calculus theories.

  4. #4
    Barjor
    Guest
    There is solutions that will never be exact>>>sqrt(3,2);<<<<will never be exact. So as fare as I know there is no way you can write a program that can extract an exact square root of any number. You can use the theory from prev post and run it until it is good enough
    ~Barjor

  5. #5
    Unregistered
    Guest

    Question microsoft calculator

    i thought the same thing but then i remembered that
    the default calculator that comes with windows can
    calculate exact square roots.

    I have to either right a program that can calculate square roots or absolute value, though if I can get the square root part down, i can use that for absolute value. Hopefully some can either assure there is no way or point me in the right direction of the right way.

  6. #6
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    The windows calc probably just uses QWORDS and uses the FSQRT instruction to get the square root.

    With the FPU, no need to code an integer sqrt function or a floating point sqrt function. The days of floating point emulation ended with the FPU.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Math
    By knightjp in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 04-01-2009, 05:36 PM
  2. Help with C++ Math
    By aonic in forum C++ Programming
    Replies: 4
    Last Post: 01-29-2005, 03:40 AM
  3. Basic Math Problem. Undefined Math Functions
    By gsoft in forum C Programming
    Replies: 1
    Last Post: 12-28-2004, 02:14 AM
  4. Math Header?
    By Rune Hunter in forum C++ Programming
    Replies: 26
    Last Post: 09-17-2004, 06:39 AM
  5. toughest math course
    By axon in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 10-28-2003, 09:06 PM

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