<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Am 16.02.2024 um 08:32 schrieb Florian
Klämpfl via fpc-pascal:<br>
</div>
<blockquote type="cite"
cite="mid:D917A1EC-A5AA-4329-BAE9-B52723463A1D@freepascal.org"><span
style="white-space: pre-wrap">Am 16.02.2024 um 08:23 schrieb Ern Aldo via fpc-pascal <a class="moz-txt-link-rfc2396E" href="mailto:fpc-pascal@lists.freepascal.org"><fpc-pascal@lists.freepascal.org></a>:</span>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
Compile-time math needs to be as correct as possible. RUN-time math can worry about performance.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
So you are saying when constant propagation is on, an expression should have a different result than with constant propagation off?
</pre>
</blockquote>
<p>I don't know exactly, what you mean by constant propagation. <br>
</p>
<p>But IMO, given this (sort of fictive) Pascal code snippet: <br>
</p>
<p><br>
const Xconst : single = 1440.0; </p>
<p>var y1, y2 : real; </p>
<p>y1 := 33.0 / 1440.0; </p>
<p>y2 := 33.0 / Xconst; <br>
</p>
<p><br>
the division in the first assignment (to y1) should be done at
maximum precision, that is, <br>
both constants should be converted by the compiler to the maximum
available precision and <br>
the division should be done (best at compile time) using this
precision. <br>
</p>
<p>in the second case, if the compiler supports constants of the
reduced type (which I believe it does, <br>
no matter how the syntax is), I find it acceptable if the
computation is done using single precision, <br>
because that's what the developer calls for. <br>
</p>
<p>So probably the answer to your question is: yes. <br>
</p>
<p>Kind regards <br>
</p>
<p>Bernd <br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:D917A1EC-A5AA-4329-BAE9-B52723463A1D@freepascal.org">
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
</body>
</html>