HP3000-L Archives

June 1998, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Paul Edwards <[log in to unmask]>
Reply To:
Date:
Fri, 19 Jun 1998 18:12:16 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
Glenn, thanks for the help. That cured the problem! I assumed that the
compiler would strip off the commas and period and then convert it to an
integer. Goes to show what happens when you assume.

[log in to unmask] wrote:

> Paul Edwards writes:
>
> > Has anyone experienced this problem/bug? Version: COBOL HP31500A.04.14.
> > When using the FUNCTION NUMVAL-C on a field - X(12) - that has "158.20"
> > in it, the output field - S9(06)V99 - is "15819". Most of the other
> > records pass OK with no changes. About 27 records out of about 700 get
> > changed this same way by rounding down .01. None of the values are the
> > same.
>
> I assume this is a result of the imprecision of representing 158.20
> as a floating-point value.
>
> I verified (at least with this specific example) that you can get
> the desired result using ROUNDED, e.g.,
>
>         COMPUTE PW-NUM ROUNDED = FUNCTION NUMVAL-C( PW-CHAR ).
>
> --Glenn Cole
>   Software al dente, Inc.
>   [log in to unmask]
>
> .......................................................................
>
> Item Subject: cc:Mail Text



--
*****************************************************************
* Paul Edwards                     HP 3000 Certified Consultant *
* Paul Edwards & Associates                 1506 Estates Way    *
* Email: [log in to unmask]                   Carrollton TX 75006 *
* Phone: (972) 242-6660                     Fax: (972) 446-9022 *
*****************************************************************

ATOM RSS1 RSS2