Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Motion 46: finalise interval literals



Vincent,

> You should give an example with a power of 10, because not everyone
> has the same definition of ulp for such a number. Say, "100?" is
> [99.5,100.5]. Also, it is ambiguous for 0: is it defined or not?
> For instance, "0?", "0.0?", etc. The ulp of 0 is not defined, but
> it can make sense to define "0?", "0.0?", etc.

I think that this phrase from the text is sufficient:
"One ulp equals one unit in the last place of the number m as written."
It defines ulp not in terms of value but in terms of string. So
0? = [-0.5,+0.5]
0.0? = [-0.05,+0.05]

> Moreover the grammar doesn't match (1). According to (1), "011" is
> 9 in C, but according to the grammar, it is 11, in the context of
> ratNumLit.

I suggest that interval intervals in the standard are portable.
Program P1 in language L1 in locale Loc1 writes text file with interval literals
and program P2 in language L2 in Local Loc2 reads them correctly.

So I would replace host-language items by concrete items
langNumLit     {langNumLiMant} {langNumLitExp}?
langNumLitMant {sign}? ( {digit}+ ( "." {digit}* )? | "." {digit}+ )
langNumLitExp  anycase("e") {sign}? {digit}+
sp             ( " " | "\t" )*

Then "011" in interval literals is always 11.
We may write a warning in the standard.

> Also, what about locales? Is this for the "default" locale only or
> for all locales? In the latter case, for Turkish locales, "Inf" would
> not be accepted as an infinity.

I think that interval literals should be locale-independent (or in CC locale).

  -Dima


----- Исходное сообщение -----
От: vincent@xxxxxxxxxx
Кому: stds-1788@xxxxxxxxxxxxxxxxx
Отправленные: Четверг, 11 Июль 2013 г 18:01:57 GMT +04:00 Абу-Даби, Маскат
Тема: Re: Motion 46: finalise interval literals

On 2013-07-11 09:21:02 +0100, John Pryce wrote:
> For the current motion, I attach final text to be voted on. I've
> done a bit of rewriting, but the main change is that I've hopefully
> lessened the above conflict by making "rational endpoints", i.e.
> rational number literals, optional. Besides infsup form [5.6,7.8],
> Neumaier's uncertain form 5.6?1 stays because I think it is useful,
> and easy to read once you get used to it.

You should give an example with a power of 10, because not everyone
has the same definition of ulp for such a number. Say, "100?" is
[99.5,100.5]. Also, it is ambiguous for 0: is it defined or not?
For instance, "0?", "0.0?", etc. The ulp of 0 is not defined, but
it can make sense to define "0?", "0.0?", etc.

Moreover the grammar doesn't match (1). According to (1), "011" is
9 in C, but according to the grammar, it is 11, in the context of
ratNumLit.

Also, what about locales? Is this for the "default" locale only or
for all locales? In the latter case, for Turkish locales, "Inf" would
not be accepted as an infinity.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)