10e5 == 10^5 is not true in MATLAB
1,344 ビュー (過去 30 日間)
古いコメントを表示
If you type in
10e5 == 10^5
ans =
logical
0
so 10e5 does NOT mean 10 to the power of 5 but it means 10 to the power of 6.
10e5 == 10^6
ans =
logical
1
What does 10e5 mean then? Is it somewhere in the documentation? I just can't seem to find it, I've been looking for it for quite some time now.
Thanks for the help!
1 件のコメント
Vasileios Delimaras
2024 年 2 月 17 日
編集済み: Vasileios Delimaras
2024 年 2 月 17 日
The notation "10e5" means "10 times of 10 to the power of 5," where the "e" represents the exponent of the power of 10 (10^x). So for your example, 1e5 == 10^5.
採用された回答
その他の回答 (1 件)
chaman lal dewangan
2019 年 12 月 21 日
1e6=10^6;
1 件のコメント
John D'Errico
2023 年 7 月 9 日
@chaman lal dewangan - If you think this statement is relevant, then you don't understand floating point numbers. That it happens to work in this instance, but not for the case of 1e5, this is just mathematical happenstance. SOMETIMES, you get lucky in any such test.
1e6==10^6
But to properly use MATLAB, you don't want to leave things to mathematical happenstance, hoping to get lucky. That is just a bad idea.
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!