Truncation error

Peter Pearson pkpearson at nowhere.invalid
Wed Oct 7 15:16:45 EDT 2020


On Wed, 7 Oct 2020 13:29:26 +0530, Meghna Karkera <mkarkera98 at gmail.com> wrote:
> On Wed, Oct 7, 2020, 11:24 Marco Sulla <Marco.Sulla.Python at gmail.com> wrote:
>> On Wed, 7 Oct 2020 at 05:23, Meghna Karkera <mkarkera98 at gmail.com> wrote:
>> >
>> > How is PYTHON better than other software's(MATLAB) in case of
>> > truncation or rounding off error.
>
>> [snip]
>
> When I use the same code in MATLAB I get the answer as 4.6e-06 and when I
> use the same code in PYTHON I get the answer as 4.7e-06. How do I know
> which is the most precise and accurate value. Actually the answer is a big
> matrix, I've only compared the first entry of the matrix.

I hope your big matrix has many elements much larger than 4.7e-06,
so that you don't really have to worry about which package has the
smaller roundoff error.  If you *are* in the situation of having to
worry about roundoff error, that's likely to mean that you have to
plan your entire computation around the goal of minimizing its
susceptibility to tiny amounts of noise, and that's a problem much
more complex than choosing a language.

-- 
To email me, substitute nowhere->runbox, invalid->com.


More information about the Python-list mailing list