ERROR: floating constant is out of range

21 vues (au cours des 30 derniers jours)
Hai Nguyen
Hai Nguyen le 5 Mai 2019
Commenté : Dajr Alfred le 15 Mai 2023
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 commentaire
Walter Roberson
Walter Roberson le 29 Oct 2022
Modifié(e) : Walter Roberson le 29 Oct 2022
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

Connectez-vous pour commenter.

Réponse acceptée

Mike Hosea
Mike Hosea le 7 Mai 2019
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 commentaires
Mike Hosea
Mike Hosea le 29 Oct 2022
You could start here.
Dajr Alfred
Dajr Alfred le 15 Mai 2023
The easiest way to accomplish this with simulink is to use the Single Point Converter in the Apps tab

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by