Question/request/bug(?) re. floating-point in dmd
Jerry
jlquinn at optonline.net
Thu Nov 7 08:55:20 PST 2013
"Don" <x at nospam.com> writes:
> On Wednesday, 6 November 2013 at 06:28:59 UTC, Walter Bright wrote:
> Perhaps an attribute rather than a function call.
>
> double x;
> double y = x.strictfloat;
> double y = x.strictprecision;
>
> ie, (expr).strictfloat would return expr, discarding any extra precision.
> That's the best I've come up with so far.
What about something like the following?
double x;
double y;
with (strictprecision) {
y = x;
}
The idea being that you can create a scope within which operations are
executed with no extra precision.
Jerry
More information about the Digitalmars-d
mailing list