i want to substract very large value from small value in matlab?

5 ビュー (過去 30 日間)
GHUFRAN AHMAD KHAN
GHUFRAN AHMAD KHAN 2018 年 12 月 30 日
コメント済み: Walter Roberson 2019 年 1 月 5 日
small value = 2.3654
large value = 6.7843e+130
Answer = small value - large value
try to find the substraction but every time i got answer -6.7843e+130.

回答 (1 件)

madhan ravi
madhan ravi 2018 年 12 月 30 日
-6.7843e+130 is just a scientific notation of -6.7843*10^130 ,because the number is really huge matlab shows them as such.
  5 件のコメント
GHUFRAN AHMAD KHAN
GHUFRAN AHMAD KHAN 2019 年 1 月 4 日
i have already symbolic toolbox but still problem could not resolved.
Walter Roberson
Walter Roberson 2019 年 1 月 5 日
>> digits(135)
>> smallvalue = sym('2.3654')
smallvalue =
2.3654
>> largevalue = sym('6.7843e+130')
largevalue =
67843000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0
>> answer = smallvalue - largevalue
answer =
-67842999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999997.6346

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by