Thread: Factoring

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    1

    Unhappy Factoring

    I know I can use a calculator, but I want to program my own . I am new in c++ I am now having a problem finding the lowest common multiple of two numbers. I can't seem to find information on how to factor a number down so I can do this. So I need help on how to factor a number. I know how to capture it into pices if I can only get it to give me the factor of the number as a single digit.

    please help me.

  2. #2
    aoeuhtns
    Join Date
    Jul 2005
    Posts
    581
    Don't do it that way. Do it this way:

    lcm(x,y) = x / gcd(x,y) * y

    Finding the gcd is simple enough and doesn't require factoring. (Search for Euclid's algorithm.)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Factoring app
    By Asbestos in forum C++ Programming
    Replies: 2
    Last Post: 05-21-2005, 11:15 AM
  2. Mathematics - Factoring Fractional Exponents
    By xddxogm3 in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 02-09-2005, 04:49 PM
  3. Mathematics (Factoring and Logarithms)
    By xddxogm3 in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 11-27-2004, 06:09 PM
  4. Factoring Polynomials in C++
    By MethSnax in forum C++ Programming
    Replies: 3
    Last Post: 07-21-2003, 01:51 PM
  5. Quadratic Factoring
    By neandrake in forum C++ Programming
    Replies: 11
    Last Post: 04-15-2002, 04:49 PM