[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about display of precision
From: |
Andy Buckle |
Subject: |
Re: Question about display of precision |
Date: |
Thu, 1 Dec 2011 10:39:58 +0000 |
On 1 December 2011 10:26, Walter White <address@hidden> wrote:
> Hello,
>
> I have a question and hope that you can help me to understand that.
>
> I use str2double to convert a cell array of strings (output from strsplit).
>
> Outputting the cell array of strings, it says
>
> ...
> [1,28] = 999999999
> ...
>
> Outputting the according number in the array converted with str2double says
>
> ...
> Columns 28 through ...
> ... 1.0000e+9 ...
>
> But if I explicitly output the converted numeric value in the array it reads
> 99999999, as expected.
>
> Why is 1.0000e+9 displayed, instead of the "more correct" calue 9.9999e+8 ??
>
> Kind regards,
> Walter
I don't understand
To 4 decimal places 1e9 /is/ the closest way of expressing the number.
>a=999999999
a = 999999999
>a-1e9
ans = -1
>a-9.9999e8
ans = 9999
--
/* andy buckle */