bugGNU Octave - Bugs: bug #29870, Precision doesn't work properly on...

 
 

bug #29870: Precision doesn't work properly on dlmwrite

Submitted by:  None
Submitted on:  Wed 12 May 2010 04:15:10 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: David GessweinOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.2.4
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 12 May 2010 11:30:40 PM UTC, comment #1:

I applied your patch and corrected the problem. See
http://hg.savannah.gnu.org/hgweb/octave/rev/044d9df4d79a

Thanks for contributing.

Rik <rik5>
Project Administrator
Wed 12 May 2010 04:15:10 PM UTC, original submission:

a = [2.5 + 3.200001i 5.3 + 4.4i];
dlmwrite('test.cvs',a,'precision',9)

gives file
2.5g3.2gi,5.3g4.4gi

If I change line 124 in
/usr/share/octave/packages/io-1.0.9/dlmwrite.m
from
precision = sprintf ("%.%gg", precision);
to
precision = sprintf ("%%.%gg", precision);

then I get expected result
2.5+3.200001i,5.3+4.4i

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 12 May 2010 11:30:40 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1