[Info-vax] New VSI Roadmap (yipee!)
David Froble
davef at tsoft-inc.com
Tue Mar 3 11:32:18 EST 2015
John Reagan wrote:
> On Tuesday, March 3, 2015 at 10:07:10 AM UTC-5, David Froble wrote:
>
>> As for those worrying about absolute precision with currency, when the
>> CEO of a distribution company wants to see the monthly bookings and
>> billings, he may want to see it rounded to thousands, and most
>> definitely not pennys.
>
> But I suspect the accountants or the class-action lawyers will care.
>
>> All I did was two things, first mentioned that we have been very
>> successful in using FP for currency, and second asked for a rounding
>> function as part of a language.
>>
>
> Since you've done this for a long time, you've went from VAX to Alpha
> in the that timeframe. Did the switch from D to G (which drops 3
> bits of mantissa) make a difference?
Actually, this began back on RSTS/E and Basic Plus. Long time ago.
The switch from D to G was interesting. While we use D-Float, I'm aware
that calculations are done in G-Float. I've seen some minor problems.
But not in the currency calculations. With currency, after EVERY
calculation, a round is performed, to inhibit the drift. If you didn't
dod this, there would be drift, and sometimes you'd be off a penny.
Now, the accounting types would question this, but for other things it
just wasn't an issue, and a non-issue once the practice of rounding
after every calculation was implemented.
But yeah, FP can be fun.
> If you want to count pennies, use X_float. You get 33 digits of
> pennies. Using X_float to count integral things is fine. You have
> to provide your own scaling of course.
For companies with say, $100 million a year in sales, you'd never have a
problem with the 15 digits of precision in D-Float.
> Back to the rounding function, I can see why YOU want such a thing
> given the routine call overhead in BASIC, but lets see if we can fix
> the routine call overhead issue instead of adding builtin after
> builtin after builtin. Maybe some keyword on the subroutine or such?
I cannot remember the details, but back in the dim past Randy Park
developer a report writer utility he called XENTIS, and he ran into the
overhead of the subroutine calls. He found some compiler switch, which
i cannot remember nor find, that bypassed some of the set-up and
break-down of calling subroutines. I seem to recall that it had to do
with error trapping.
But yes, what you suggest would be a good thing. Modular programming
techniques lead to calling subroutines and external functions, and
improving that would be helpful.
How do other languages handle such?
More information about the Info-vax
mailing list