Re: int2interval, frac2interval, rat2interval
Dima,
But "rational" data types, to my knowledge, have not been included
in arithmetic standards in the past, so we'd have more work defining
what we meant. (In contrast, for example, both binary floating point
and decimal data types are defined in 754-2008, so our standard could
relate to one or more of those.) Were you thinking of a particular language
standard with a rational data type? Also, do you have practical motivation
for including a rational data type?
Finally, are you going to submit a formal motion, or should I take your
email (appended) as a formal motion?
Best regards,
Baker
On 04/18/2012 10:11 PM, Dmitry Nadezhin wrote:
Previously, I noticed that we forgot about constructors like int2rational.
It was too late and I didn't want to disturb voting of motions M030.02 and M031.01 .
Now they passed and I want to prepare a motion(s) that add such constructors.
-Dima
-------------------
1) Add following items to section 3.2 Definitions of the Level 1 text approved by the motion 31.
3.2.999. integer. Any member of the set Z of integer numbers.
3.2.999. rational. Any member of the set Q of rational numbers.
2) Add following paragraphs to the constructor text approved by the motion 30.
- The constructor int2bareinterval(i) is defined for an integer value i.
Its value is the singleton interval [i,i] = { i }.
- The constructor frac2bareinterval(p,q) is defined for a pair of integer values (p,q) with q> 0.
Its value is the singleton interval [p/q,p/q] = { p/q }.
3) Add a phrase to 5.7 (Recommended operations(informative)).
- The recommended constructor rat2bareinterval(r) is defined for a rational value r.
Its value is the singleton interval [r,r] = { r } .
4) Add new constructors to the list in the last paragraph o fthe constructor text.
The decorated interval constructors nums2interval(l,u), int2interval(i), frac2interval(p,q), rat2interval(r), text2interval(t), empty(), entire() are defined as follows....
------------------
Rationale .
User may need to write an expression with precoomputed rational number like
(1/n!)*x^n .
User could compute interval extendsion of 1/n! using mul/div interval operations,
but this accumulates rounding errors for large n.
Underlying system may have types that implement integers or rationals that
can't be represented by default number format (like double):
- "long long int" types; with larger precision than precision of default number format (double).
- arbitrary size integers like GMP "mpz", or Java "BigInteger".
- arbitrary size rationals like GMP "mpq";
User could compute exact rational number 1/n! using above type, then convert it to text, then use text2interval constructor,
but text2interval doesn't define details of text representation, so this may be not portable.
So it is desirable to have Level 1 operations that convert rational numbers to intervals.
The corresponding Level 2 constructors will return the hull of Level 1 singleton interval.
The hull may become non-sigleton for some inputs, but it will not suffer from double-rounding.
---------------------
--
---------------------------------------------------------------
Ralph Baker Kearfott, rbk@xxxxxxxxxxxxx (337) 482-5346 (fax)
(337) 482-5270 (work) (337) 993-1827 (home)
URL: http://interval.louisiana.edu/kearfott.html
Department of Mathematics, University of Louisiana at Lafayette
(Room 217 Maxim D. Doucet Hall, 1403 Johnston Street)
Box 4-1010, Lafayette, LA 70504-1010, USA
---------------------------------------------------------------