ERROR: floating constant is out of range

9 ビュー (過去 30 日間)
Hai Nguyen
Hai Nguyen 2019 年 5 月 5 日
コメント済み: Dajr Alfred 2023 年 5 月 15 日
I have created a algorithm in Simulink. I tried to implement this model to TI TMS320F28379D LAUNCHXL board embedded target. When I try to build the model, I receive the following error messages.
Capture.JPG
This is one of the code segments that caused error
Capture1.JPG
  1 件のコメント
Walter Roberson
Walter Roberson 2022 年 10 月 29 日
編集済み: Walter Roberson 2022 年 10 月 29 日
I wonder where that constant comes from; too bad it isn't documented. It happens to be 0x1cc0000000000000 but that does not tell me anything about what it represents.
Ah... with further checking I see that it is
format long g
eps(sqrt(realmin))
ans =
3.31216864211124e-170
and that suggests its replacement value should be
eps(sqrt(realmin('single')))
ans = single
1.29247e-26

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

採用された回答

Mike Hosea
Mike Hosea 2019 年 5 月 7 日
That number is well within the range of IEEE double precision floating point numbers, but the TI TMS320F28379D has native 32bit IEEE single precision floating point. I'm not sure what the C compiler for it does with double precision data, but based on what you have shown, it doesn't seem to support IEEE double precision floating point, even in emulation. Try using single precision.
  3 件のコメント
Mike Hosea
Mike Hosea 2022 年 10 月 29 日
You could start here.
Dajr Alfred
Dajr Alfred 2023 年 5 月 15 日
The easiest way to accomplish this with simulink is to use the Single Point Converter in the Apps tab

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by