How to Maximize the Variable within given bounds

How would one go about finding the largest number x (one significant digit is enough) such that the numerical evaluation of expression (1 + x) − 1 equals to zero.
I need to show that MatLab gives strange answers sometimes (thanks to Floating-point arithmetic).

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 8 月 30 日

0 投票

x = eps(1/2)

1 件のコメント

Benjamin Halkowski
Benjamin Halkowski 2015 年 8 月 30 日
Thank you, but is there anyway to have MATLAB spit out this infinitesimal amount while solving for the linear function above?

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

カテゴリ

ヘルプ センター および File ExchangeNumeric Types についてさらに検索

質問済み:

2015 年 8 月 30 日

コメント済み:

2015 年 8 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by