Replacement for undocumented function feature('setround')

4 vues (au cours des 30 derniers jours)
Myron
Myron le 7 Fév 2025
Commenté : Myron le 7 Fév 2025
Is there a documented MATLAB replacement for the undocumented function feature(‘setround’)? It is fine if the answer is no. I'm just trying to confirm that is the case.
I have been using that function successfully to control how single handles tie-breakers when converting a value to single-precision. Using the C function fesetround is not an option I can use. At first glance using round(___,TieBreaker=”tozero”) seemed promising. However, that rounds before passing a value to single rather than controlling the behavior of the rounding decision within single itself.
Ex.
feature('setround', 0); %configure single to round tie-breakers towards 0
a_single = single(a);
feature('setround', 0.5); %return to default rounding configuration

Réponse acceptée

Adam Danz
Adam Danz le 7 Fév 2025
Déplacé(e) : Adam Danz le 7 Fév 2025
> Is there a documented MATLAB replacement for the undocumented function feature(‘setround’)?
There currently is not a documented means of controlling the rounding method for single data type value. However, Fixed-Point Designer has a quantizer object that lets you specify the rounding mode. See RoundingModes page for more info
  1 commentaire
Myron
Myron le 7 Fév 2025
Thank you for the confirmation/information.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by