At 1:39 PM -0400 8/24/04, Simon Glover wrote:
On Tue, 24 Aug 2004, Dan Sugalski wrote:>

6) Division of two ints produces a bignum

Surely it should only produce a bignum as a last resort. For instance, shouldn't:

  4 / 3

produce a float?

A float or a bignum, both are reasonable. There's that whole issue of speed, though. (And to some extent precision)


 Also, what about a case like:

 4 / 2

Does that produce an int, a float or a bignum?

Good question.

 > 9) Any operation with a bignum produces a bignum

 Should there be some way to test whether a bignum can be downgraded into
 a float?

Probably, yeah. At the moment I'm somewhat loathe to drop down to floats because of the loss of precision.


The big question is whether being clever and producing the tightest type is worth the time to figure out what that type is, as well as the potentially uncertain output type.

I don't have a choice I think is right, though I'm leaning towards an answer that's got a consistent output type, though I'm not sure what that type should be.
--
Dan


--------------------------------------it's like this-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to