bugGNU Octave - Bugs: bug #45170, Unexpected results

 
 

bug #45170: Unexpected results

Submitted by:  None
Submitted on:  Sat 23 May 2015 08:17:11 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Inaccurate Result
Status: Works For MeAssigned to: None
Originator Name: CK RajuOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.8.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.

 

Sat 23 May 2015 12:21:09 PM UTC, comment #1:

Thanks for your bug report. Both of your examples work fine for me. There isn't really a clear bug here, so closing.

I'd propose that you instead send a message to the help mailing list for suggestions about figuring out why you are seeing the behavior you are. And please do show the actual error or unexpected output instead of saying it doesn't work.

See also help dec2bin, your while loop is the same as calling dec2bin(linenumber, 15).

Mike Miller <mtmiller>
Project Administrator
Sat 23 May 2015 08:17:11 AM UTC, original submission:

# case 1 === this code snippet ALWAYS works
binstring = dec2bin(linenumber); [a,b] = size(binstring);
while (b<15),
pcode = horzcat("0", binstring);
binstring = pcode;
b = b + 1;
end;
pcode=binstring; # Why should this be ESSENTIAL
fputs(flabel, horzcat(plabel,":",pcode,"\n"));

# case 2 === this code snippet doesn't work ALWAYS
binstring = dec2bin(linenumber); [a,b] = size(binstring);
while (b<15),
pcode = horzcat("0", binstring);
binstring = pcode;
b = b + 1;
end;
fputs(flabel, horzcat(plabel,":",pcode,"\n"));

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 mtmiller (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
    Sat 23 May 2015 12:21:09 PM UTCmtmillerStatusNone=>Works For Me
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1