SourceForge has been redesigned. Learn more.

#206 Allow easy comparisons with 0 (zero)


In ::math::bignum, most of the comparison functions
(except for iszero) require two bignums as inputs.
However, there are many cases where the comparison is
between 0 and some number.

Right now, you need to make a bignum of 0 to do the
comparison. It should be possible to special case the
comparisons so that the comparison is against the
literal 0 would be permitted.

Another possibility would be to predefine two useful
numbers as bignum constants: 0 and 1. With those two
predefined, a lot of tests would be able to avoid
having to create them. (Other powers of two (2^1, 2^2,
2^3, ...2^64) would be potentially useful as well, but
perhaps less worth the overhead.)


  • Andreas Kupries

    Andreas Kupries - 2005-08-23

    Logged In: YES

    Assigned to creator/maintainer

  • Andreas Kupries

    Andreas Kupries - 2005-08-23
    • labels: --> math :: bignum
    • assigned_to: nobody --> sarnold75
  • Anonymous

    Anonymous - 2005-08-27
    • status: open --> pending
  • Anonymous

    Anonymous - 2005-08-27

    Logged In: YES

    The two constants '0' and '1' have been defined in each
    high-level proc.
    The test suite was improved with new tests, including tests
    not devoted to this evolution. (division, modulo, remainder...)

    A hook (_treat) was created to handle the constants :
    _treat var ?var ...?

    Replace each variable named 'var' by the internal
    representation if it is equal to one of the constants : '0'
    or '1'. If the variable is already in internal repr, nothing
    is done.

    Please close this feature request, or tell the issues, if
    they are some.

  • Anonymous

    Anonymous - 2005-08-30
    • status: pending --> closed