Many architectures do not support real, and therefore it should never be used implicitly by the language.<div><br></div><div>Precision problems aside, I would personally insist that implicit conversation from any sized int always be to float, not double, for performance reasons (the whole point of a compiled language trying to supersede C/C++).</div>
<div>Amusingly, 5_000_000_000 IS actually precisely representable with a float ;) .. Bet let's take 5_000_000_001, it'll lose a few bits, but that's more than precise enough for me.</div><div><br></div><div>Naturally the majority would make solid arguments against this preference, and I would agree with them in their argument, therefore should it not just be a compiler flag/option to explicitly specify the implicit int->float conversion precision?</div>
<div><br></div><div>Though that leads to a problem with standard library, since it links a pre-compiled binary... I can't afford to have the standard library messing around with doubles because that was the flag it was compiled with...</div>
<div>This leads inevitably to my pointlessly rewriting the standard library functions in my own code, just as in C where the CRT uses doubles, for the same reasons...</div><div><br></div><div><br></div><div><div class="gmail_quote">
On 20 October 2011 06:01, Steven Schveighoffer <span dir="ltr"><<a href="mailto:schveiguy@yahoo.com">schveiguy@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Wed, 19 Oct 2011 22:57:48 -0400, Robert Jacques <<a href="mailto:sandford@jhu.edu" target="_blank">sandford@jhu.edu</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, 19 Oct 2011 22:52:14 -0400, Marco Leise <<a href="mailto:Marco.Leise@gmx.de" target="_blank">Marco.Leise@gmx.de</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Am 20.10.2011, 02:46 Uhr, schrieb dsimcha <<a href="mailto:dsimcha@yahoo.com" target="_blank">dsimcha@yahoo.com</a>>:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 10/19/2011 6:25 PM, Alvaro wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
El 19/10/2011 20:12, dsimcha escribió:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
== Quote from Don (<a href="mailto:nospam@nospam.com" target="_blank">nospam@nospam.com</a>)'s article<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The hack must go.<br>
</blockquote>
<br>
No. Something as simple as sqrt(2) must work at all costs, period. A<br>
language<br>
that adds a bunch of silly complications to something this simple is<br>
fundamentally<br>
broken. I don't remember your post on implicit preferred conversions,<br>
but IMHO<br>
implicit conversions of integer to double is a no-brainer. Requiring<br>
something<br>
this simple to be explicit is Java/Pascal-like overkill on<br>
explicitness.<br>
</blockquote>
<br>
Completely agree.<br>
<br>
I call that uncluttered programming. No excessive explicitness should be<br>
necessary when what you mean is obvious (under some simple conventions).<br>
Leads to clearer code.<br>
<br>
</blockquote>
<br>
Yes, and for the most part uncluttered programming is one of D's biggest<br>
strengths.  Let's not ruin it by complicating sqrt(2).<br>
</blockquote>
<br>
What is the compiler to do with sqrt(5_000_000_000) ? It doesn't fit into<br>
an int, but it fits into a double.<br>
</blockquote>
<br>
Simple, is a 5_000_000_000 long, and longs convert to reals. Also, 5_000_000_000 does not fit, exactly inside a double.<br>
</blockquote>
<br></div></div>
It doesn't?  I thought double could do 53 bits?<br>
<br>
Although I agree, long should map to real, because obviously not all longs fit into a double exactly.<br>
<br>
-Steve<br>
</blockquote></div><br></div>