Strange (lack of) round-off error using norm
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have found this behaviour:
>> format hex
>> p=[sqrt(2) sqrt(2)]*1e3;
>> sqrt(sum(p.^2))
ans =
409f400000000001
>> norm(p)
ans =
409f400000000000
I understand the round-off error using sqrt. What I do not understand is how does norm do to avoid it.
Thanks,
Mariano
2 件のコメント
David Goodmanson
2019 年 2 月 17 日
Hi Mariano
I ran this on my PC and got
ans = 409f400000000001
ans = 409f400000000001
Not sure what to say .....
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!