help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug?


From: Marco Atzeri
Subject: Re: Bug?
Date: Tue, 21 Jun 2016 23:20:15 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1



On 21/06/2016 21:10, Dr.-Ing. Dieter Jurzitza wrote:
Dear listmembers,
when printing with printf I stumbled across something strange (to me ...):

A=linspace(0,10,10);
printf("%d\n", A);
0
1.11111
2.22222
3.33333
4.44444
5.55556
6.66667
7.77778
8.88889
10


I intentionally forced linspace to create a list of floats.

I say strange because I didn't expect this. The format specifier "%d" says an
integer is going to be printed. And what is the outcome? floats!

Matlab does apparently the same - so, is this (in my understanding erratic
...) behaviour a compatibility - feature?

Thank you very much for clarifying,
take care




Dieter Jurzitza


%d means decimal format not integer








reply via email to

[Prev in Thread] Current Thread [Next in Thread]