[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regarding Octave's gcd()
From: |
Mansour Moufid |
Subject: |
Re: Regarding Octave's gcd() |
Date: |
Fri, 19 Mar 2010 19:37:19 -0400 |
Allow me to elaborate.
Currently, Octave's gcd() doesn't correctly handle large integers. For example:
octave:1> gcd(16090699843710856058,12341318070000405756)
ans = 2048
The correct answer is 2606. (In fact, gcd() of any two large integers
always returns a power of 2...) Note that there is no warning either.
I would like to write a new gcd implementation for Octave, in C99
(with a C++ wrapper) in order to take advantage of the long long
integer type, and to handle integer overflows correctly.
Would C be acceptable, and if so, is this the right place to submit a
patch? Or is this list only for official maintainers?
Thanks again for your time.
--
Mansour Moufid