bugGNU Octave - Bugs: bug #37254, zeros() matrix wrong dimension

 
 

bug #37254: zeros() matrix wrong dimension

Submitted by:  None
Submitted on:  Sun 02 Sep 2012 04:43:29 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: MauOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.2
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.

 

Tue 04 Sep 2012 08:10:43 AM UTC, comment #5:

Thanks for your replies. Although I knew that computer calculations werent flawless I have never thought of such cases as possible.
I apologize for my mistake (and ignorance :)).

Maurizio <mau>
Tue 04 Sep 2012 01:52:10 AM UTC, comment #4:

Another favourite example of mine is how 0.3 - 0.2 - 0.1 isn't zero... This isn't an Octave "problem". Try it in C, Perl, Python, Ruby or any other language that is using hardware floats.

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

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Mon 03 Sep 2012 10:24:30 PM UTC, comment #3:

Octave says:

printf("%20.16e\n",700*0.7)
4.8999999999999994e+02

Do you consider this an error?
Remember that Octave uses IEEE 754 foating point.

Michael Godfrey <godfrey>
Project Member
Mon 03 Sep 2012 10:17:12 PM UTC, comment #2:

I don't understand: 7000.7 = 707 = 490. It must be an integer.
Let's change perspective: according to octave 8000.7= 560, 5000.7 = 350, etc. Why only 700*0.7 is not an integer?

Maurizio <mau>
Sun 02 Sep 2012 05:47:48 PM UTC, comment #1:

This isn't a bug. b is not an integer. Do "format long" to see how b is not an integer. Or observe how floor(b) is not equal to b.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Sun 02 Sep 2012 04:43:29 PM UTC, original submission:

Code:

-----------------------------------------------------------------

> a=700;
> b=a*0.7

b = 490.00

> [[1:b]' zeros(b,1)];

error: horizontal dimensions mismatch (490x1 vs 489x1)

> size(zeros(b))

ans =

489 489
-----------------------------------------------------------------

Note that if I write "b=490;" than everithing works fine.

OS: debian testing 3.2.0-3-amd64

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 godfrey (Posted a comment)
  • -unavailable- added by mau (Posted a comment)
  • -unavailable- added by jordigh (Posted a comment)
  •  

    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
    Sun 02 Sep 2012 05:47:48 PM UTCjordighStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1