Re: Motion 46: finalise interval literals, amendments
Vincent,
> And should there be a limit on the size of the integers?
My opinion is that standard shouldn't limit size of literals.
> Otherwise an arbitrary precision library may be needed to
> evaluate (simplify) rational numbers.
Arbitrary precision library is not a trouble.
Conversion of decimal string to binary floating-point
with correct rounding already requires
arbitrary precision library.
As example, OpenJDK implementations of
Java Double.parseDouble and Float.parseFloat use
specialized arbitary precision class sun.misc.FDBigInteger
http://cr.openjdk.java.net/~bpb/7032154/src/share/classes/sun/misc/FDBigInteger.java.html
Glibc implementation of strtod
http://sourceware.org/git/?p=glibc.git;a=blob_plain;f=stdlib/strtod_l.c;hb=master
uses data structure and mpn_XXX functions/macros from simplified gmp
http://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/mul.c;h=125871717bcbfb0f247d52b034a2c4f2801e8ceb;hb=master
-Dima
----- Исходное сообщение -----
От: vincent@xxxxxxxxxx
Кому: stds-1788@xxxxxxxxxxxxxxxxx
Отправленные: Вторник, 9 Июль 2013 г 16:03:29 GMT +04:00 Абу-Даби, Маскат
Тема: Re: Motion 46: finalise interval literals, amendments
On 2013-07-08 23:59:05 -0700, Dmitry Nadezhin wrote:
> Perhaps, there is an issue with leading zeroes in ratNumLit .
> Let's take ratNumLit "010/011". It's value is 10/11 .
> However, some languages treat leading zero as start of octal number,
> so some users may expect that the value of the literal is 8/9 .
>
> Will it be safer if we forbid leading zeros in ratNumLit ?
I think so.
And should there be a limit on the size of the integers?
Otherwise an arbitrary precision library may be needed to
evaluate (simplify) rational numbers.
--
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)