Page 3 of 3

Re: modulus operation

PostPosted: Fri Aug 16, 2013 7:03 pm
by Akatsukami
rajitha_nair01 wrote:but we here are asked to use intrinsic functions only if there is no otjer way out. STANDARDS!!!!...

In place of the LOG10 intrinsic function, you can use the Language Environment CEESxLG1 functions. I doubt there'll be any real difference in performance or whatnot, but you can accurately claim during code review that you didn't use an intrinsic.

Re: modulus operation

PostPosted: Fri Aug 16, 2013 8:16 pm
by BillyBoyo
I'd expect that the intrinsic FUNCTION actually uses the LE routines.

Is there a published reason for limiting the use of intrinsic FUNCTIONs?

Re: modulus operation

PostPosted: Fri Aug 16, 2013 8:25 pm
by Robert Sample
The intrinsic functions, at least for the LOG functions, are EXPLICITLY stated in the Programming Guide manual to be using the equivalent CEE routine.

LOG10 rounds the value returned for the calculation I did. Hence the correct code is
      COMPUTE WS-E-DIGITS = FUNCTION INTEGER (
                            FUNCTION LOG10 (WS-E-NUM) ) + 1 .
to replace the COMPUTE WS-E-DIGITS statement in my previous code post.

Re: modulus operation

PostPosted: Fri Aug 16, 2013 8:28 pm
by Akatsukami
BillyBoyo wrote:I'd expect that the intrinsic FUNCTION actually uses the LE routines.

Probably; this is actually a little bit of malicious compliance. To the left...

Is there a published reason for limiting the use of intrinsic FUNCTIONs?

Rajitha-chan has claimed that her shop's standards discourage use of instrinsic functions save where no other solution is possible. I opine that such standards ought to be followed as strictly -- and narrowly -- as possible.

Re: modulus operation

PostPosted: Mon Aug 19, 2013 4:57 pm
by rajitha_nair01
Used justified right with x of variable and solved the problem, and it worked. :D

thanks all for your time. :)

Re: modulus operation

PostPosted: Mon Aug 19, 2013 5:32 pm
by BillyBoyo
Hi rahtha_nair01,

Thanks for letting us know.

Can you post your working code, as it may help others with similar requirements in the future.