Matlab (2008a-32bit) single precision bug -
Matlab (2008a-32bit) single precision bug -
if create single precision operation values, give result ending 8:
>> single(single(6.500001e+02)*single(-64.1775131)*single(0.65)*single(2)) ans = -5.4230008e+004
then create operation using double precision, , same operation before, using single precision, result different first time run it:
>> double(6.5000012e+02)*double(-64.1775131)*double(0.65)*double(2) ans = -5.423000858119204e+004 >> single(single(6.500001e+02)*single(-64.1775131)*single(0.65)*single(2)) ans = -5.4230004e+004
this problem happens in matlab 2008a 32 bits. not problem in matlab 2012b 64 bits.
any thoughts on how avoid problem?
thank you.
i not test but, find on matlab central, seems bug in global workspace @versions r2008*. so, avoid problem:
don't execute code command window; stick double precision, unless under severe memory constraints (it's faster, because default type double); work in functions rather scripts (apparently function local workspace not affected bug) use r2009+ matlab release, seems have fixed bug. matlab
Comments
Post a Comment