Project

General

Profile

Support #1666

MachineInt: chase through ULL changes

Added by John Abbott about 2 years ago. Updated 12 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
-
Category:
Tidying
Target version:
Start date:
16 Feb 2022
Due date:
% Done:

10%

Estimated time:
Spent time:

Description

(2022-02-16) now using ULL as internal repr for MachineInt.
Must chase though all changes:
  • check all calls to AsSignedLong and/or AsUnsignedLong
  • check all calls to uabs (change to ul_abs or ull_abs)

Related issues

Related to CoCoALib - Design #581: C++14: MachineIntClosed2014-07-04

Related to CoCoALib - Design #1804: Use long long (at least sometimes)?In Progress2024-03-25

Related to CoCoALib - Design #934: MachineInt: change semantics?In Progress2016-09-30

Related to CoCoALib - Feature #828: MachineInt: function for checking that value is greater than some lower limit (and below MAXLONG)In Progress2015-11-30

History

#1 Updated by John Abbott about 2 years ago

#2 Updated by John Abbott about 2 years ago

We will need new tests too.

Oh joy! That C++ has inherited so many "complicated/confusing" integer types...
Designed for speed rather than safety.

I had also hoped that BOOST's numeric_cast would have been adopted in the STL... not yet, it seems.

#3 Updated by John Abbott 2 months ago

  • Target version changed from CoCoALib-0.99850 to CoCoALib-0.99900

#4 Updated by John Abbott 13 days ago

  • Related to Design #1804: Use long long (at least sometimes)? added

#5 Updated by John Abbott 13 days ago

I wonder if this change should be reconsidered in light of the discussion in #1804?

#6 Updated by John Abbott 13 days ago

  • Related to Design #934: MachineInt: change semantics? added

#7 Updated by John Abbott 13 days ago

  • Related to Feature #828: MachineInt: function for checking that value is greater than some lower limit (and below MAXLONG) added

#8 Updated by John Abbott 12 days ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

I have just removed long long from MachineInt (and had to change one call in BigIntOps.C)
There are actually 2 implementations of MachineInt: one uses an internal repr wwhich is unsigned long and a bool to say whether the value was negative; the other uses signed long without any extra bool [I have not yet updated this alternative impl]

The alternative impl is "neater" (just 1 data field) and likely faster; but is such speed important if the value is anyway going to be converted to a RingElem (or used in an operation with a RingElem)?

Also available in: Atom PDF