borked gnc_numeric_mul

Bill Gribble grib@gnumatic.com
Tue, 27 Mar 2001 13:11:35 -0600


On Tue, Mar 27, 2001 at 05:49:41PM +1000, Robert Graham Merkel wrote:
> There's something screwy happening in in gnc:numeric-mul.  Here's a
> snippet of code, and the results out of the gnc-warn . . .
>
> 		(value-num (gnc:numeric-mul units 
> 					    price
> 					    GNC-DENOM-AUTO
> 					    GNC-RND-ROUND))

This is not a legal combination of options.  GNC-DENOM-AUTO says
"determine the denominator automatically", and the last argument is
supposed to have two parts: how to compute the denominator, and how to
round.  You aren't telling it how to compute the denominator, nor
what the denominator should be. 

The code should be more diagnostic here, for sure :) If you tell me
what you wanted to have happen, I'll tell you what the last argument
should be .. my guess is that what you want is something like this: 

  (gnc:numeric-mul units price 
                   GNC-DENOM-AUTO 
                   (logior GNC-RND-ROUND
	                   (GNC-DENOM-SIGFIGS 6)))

b.g