bugGNU Octave - Bugs: bug #35894, dlmwrite writes number wrongly

 
 

bug #35894: dlmwrite writes number wrongly

Submitted by:  None
Submitted on:  Mon 19 Mar 2012 07:14:02 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: Omer SayliOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.1
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 19 Mar 2012 10:40:55 AM UTC, comment #2:

This is not a bug.

Please consult the following:

http://download.oracle.com/docs/cd/E19957-01/806-3568/ncg_goldberg.html

http://en.wikipedia.org/wiki/Floating_point_arithmetic

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Mon 19 Mar 2012 07:26:45 AM UTC, comment #1:

It seems I have forgotten machine precision. When number precicion is defined above 17 in dlmwrite (dlmwrite('out.txt', 64.6,'precision',17)) , it writes 64.599999999999994

Omer

Anonymous
Mon 19 Mar 2012 07:14:02 AM UTC, original submission:

Hi,

When you try

dlmwrite('out.txt', 64.6)

it writes

64.59999999999999,

instead of exact 64.6. (64 is example, 64.1 and 64.9, 64.4 are alike in the output file)

But if precicion is defined at least 3, it writes exact number. i.ie dlmwrite('out.txt', 64.6,'precision',3)

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 jordigh (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
    Mon 19 Mar 2012 10:40:55 AM UTCjordighStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1