SCOUG-Programming Mailing List Archives
Return to [ 13 |
February |
2005 ]
<< Previous Message <<
>> Next Message >>
Content Type: text/plain
Peter,
That's what I mean by a merry go round. You can't do it in C
as it has no native support for variable precision, fixed
decimal arithmetic. You don't have any external library
(Greg's favorite resource) in C providing such support. That
support has to be written in something else unless it does it
interpretively at runtime.
"My point (I can't speak for Greg) is that sometimes you want
exactly the value that you put in, not an approximation no
matter how low the error of the approximation."
You have to be kidding me. You can't do it by hand. You
can't do it by hardware. You can't do it by software. I take it
back. If you are willing to do a calculation on an infinite
length number like 2/3, you can start the calculation. It will
never finish. You can write an non-ending algorithm. You will
still never know the result.
"Righty-o. Try the value 1/3. I can store it as a
numerator-denominator pair in two bytes, or I can store it as
a close approximation using "all available memory"."
Well, Peter, you can and you can't. Assume you can define
such a fractional data type. When you do you have to specify
the width of the numerator and denominator. Let's say that
we define it as "dcl mynum ratio (1,1) init(1/3);". Now where
do you define the precision you want? Suppose you wanted it
to 27 places: "dcl mynum ratio (27, 1, 1) init (1/3);". Or you
could simply define it as "dcl mynum fixed dec (27, 27)
init(1/3);". The problem with "all available memory" lies with
virtual storage addressing. You don't know a priori how
much space you have. Then you have to decide what it
means if you have multiple such declarations.
"Stop restricting the data types to what your own hardware
considers "native"."
Not guilty. Never.
"Sounds like you want to offer open source algorithms. I'll
buy into that; no programming language necessary."
You write an algorithm. I'll show you at least a specification
language, if not a programming one.
"I'll admit to very little experience with specification
languages, but here's my simple test: Can a spec written with
Specification Language A be directly convertible to
Specification Language B? ..."
See. I knew you weren't listening. How many times must I
repeat that every programming language is a specification
language. If you want to say you have never written in a
programming language, then... To answer your question,
however, direct convertible always occurs from a
non-universal to a universal specification language. It may or
may not occur in the other direction.
"Darn it, Lynn, stop saying "No". If this project has merit, then
let it out the door."
I have an open door. You apparently have a closed mind.
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"postmaster@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 13 |
February |
2005 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|