Bug in LCM function (possibly 32bit integer overflow) octave 3.0.3 64bit linux

Rob Mahurin rob at utk.edu
Thu Mar 26 11:11:10 CDT 2009


> On Mar 24, 2009, at 8:33 PM, Mikael Leiviskä wrote:
>> Bug report for Octave 3.0.3 configured for x86_64-pc-linux-gnu
>>
>> Description:
>> -----------
>>
>> There seems to be an odd problem with the implementation of LCM  
>> and/or
>> possibly errornous memory handling.

I answered:
> It's probably a bug for lcm to inconsistently "upgrade" to double
> precision when passed an array of integers:
>
> octave:27> class( lcm( int32(A), int32(B) ) )
> ans = int32
> octave:28> class( lcm( [int32(A), int32(B)] ) )
> ans = double


This is fixed in the development sources.

Cheers,
Rob

-- 
Rob Mahurin
Department of Physics and Astronomy
University of Tennessee 		865 207 2594
Knoxville, TN 37996 			rob at utk.edu






More information about the Bug-octave mailing list