From: Rick M. <obj...@gm...> - 2007-12-19 09:27:49
|
The exponent of the power operation must be a whole number, which means it must be expressible as a non-exponential value under the current digits setting. 10 cannot be expressed that way without potentially losing digits of precision, so this is an error. The evaluation of the digits setting occurs with the exponent before starting the power process. Essentially, the value is processed as if you added "0" to it and the result is formatted using the current digits setting. Thus "10" ends up being "1E1" under numeric digits 1 and is invalid. However, it appears I have broken this on 3.3.0, since it's not giving an error on the trunk. I'll have to take a look at that. Rick On Dec 18, 2007 11:12 PM, Mark Miesfeld <mie...@gm...> wrote: > Rick and David, I'd like your input on this. (And anyone else that > cares to comment of course, but with Rick's role as the Principal > Architect > I guess I was looking to his comments first.) > > This simple Rexx: > > numeric digits 1 > > a = 2 ** 10 > say 'a:' a > > produces this error under 3.2.0: > > 3 *-* a = 2 ** 10 > Error 26 running E:\work.ooRexx\tryExponent.rex line 3: Invalid whole > number > Error 26.8: Operand to the right of the power operator (**) must be a > whole number; found "10" > > That doesn't seem right to me. > > 1.) 10 *is* a whole number. > > 2.) I'm not sure when the precision of 1 is applied to the evaluation > of this arithmetic operation, but it seems to me that no matter when > it is applied, 2 ** 10 is a valid expression and should result in an > answer. > > -- > Mark Miesfeld > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > |