Walter Bright:

> Don:
> > PROPOSAL:
> > Change the spec by adding the line to float.html:
> > "If the floating-point rounding mode is changed within a function, it 
> > must be restored before the function exits. If this rule is violated 
> > (for example, by the use of inline asm), the rounding mode used for 
> > subsequent calculations is undefined."
> 
> I added it into float.html for D2.

An important purpose of a not bug-prone language is remove as many undefined 
situations as possible. If you add that to D2 specs, can the compiler catch at 
compile time all cases of violations to that rule?

D has something for the actions that must be done before the function exits, 
the scope(exit). Can something like that be used to automatically avoid 
undefined rounding situations?

Bye,
bearophile

Reply via email to