Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModelicaServices: machine constants #3081

Closed
AHaumer opened this issue Aug 5, 2019 · 1 comment
Closed

ModelicaServices: machine constants #3081

AHaumer opened this issue Aug 5, 2019 · 1 comment
Assignees
Labels
discussion Discussion issue that it not necessarily related to a concrete bug or feature duplicate Duplicate issue enhancement New feature or enhancement L: Constants Issue addresses Modelica.Constants
Milestone

Comments

@AHaumer
Copy link
Contributor

AHaumer commented Aug 5, 2019

I know that ModelicaServices are "models and functions used in the Modelica Standard Library requiring a tool specific implementation".
Nevertheless, is it desired that machine constants depend on the tool and/or the computer where a model is simulated?
Do we get results that can be compared (if the models uses machine constants to prevent from overflow or underflow)?
Does it make sense to provide functions to compute some machine constants in a reliable way?
I have test implementations:

function small
  extends Modelica.Icons.Function;
  output Real result;
protected 
  Integer n;
algorithm 
  n := 1;
  while 1/2^n > 0 loop
    n := n+1;
  end while;
  result := 1/2^(n-1);
end small;
function eps
  extends Modelica.Icons.Function;
  output Real result;
protected 
  Integer n;
algorithm 
  n := 1;
  while 1+1/2^n > 1 loop
    n := n+1;
  end while;
  result := 1/2^(n-1);
end eps;
@AHaumer AHaumer added enhancement New feature or enhancement question Unexplained or undecided issue discussion Discussion issue that it not necessarily related to a concrete bug or feature labels Aug 5, 2019
@AHaumer AHaumer added this to the MSL4.0.0 milestone Aug 5, 2019
@AHaumer
Copy link
Contributor Author

AHaumer commented Aug 5, 2019

Sorry for opening a new issue: compare #2056

@dietmarw dietmarw added the duplicate Duplicate issue label Aug 5, 2019
@dietmarw dietmarw closed this as completed Aug 5, 2019
@beutlich beutlich modified the milestones: MSL4.0.0, never Aug 5, 2019
@beutlich beutlich removed the question Unexplained or undecided issue label Aug 15, 2019
@beutlich beutlich added the L: Constants Issue addresses Modelica.Constants label Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion issue that it not necessarily related to a concrete bug or feature duplicate Duplicate issue enhancement New feature or enhancement L: Constants Issue addresses Modelica.Constants
Projects
None yet
Development

No branches or pull requests

4 participants