Project

General

Profile

Design #1166

C++11: allows large integer literals (in NumTheory-prime.C)

Added by John Abbott over 6 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Portability
Target version:
Start date:
12 Mar 2018
Due date:
% Done:

100%

Estimated time:
0.77 h
Spent time:

Description

I would like to include some "large" (greater than 2^32) integer literals in NumTheory-prime.C.

This cannot be done directly and portably with C++ older than c++11 because there is no guarantee of existence of an integer type with more than 32-bits, and programs containing literals which are too big are "ill-formed" (not sure what that really means).


Related issues

Related to CoCoALib - Feature #82: C++11 compatibility questionsClosed2012-01-26

History

#1 Updated by John Abbott over 6 years ago

  • Related to Feature #82: C++11 compatibility questions added

#2 Updated by John Abbott over 6 years ago

  • Category set to Portability
  • Status changed from New to In Progress
  • Target version set to CoCoALib-0.99600
  • % Done changed from 0 to 10

I'd like the code to compile whenever a 64-bit (or wider) integer type is available. This is guaranteed if the C++ standard is at least c++11, but may also happen with the older standard. Anyway, we are hoping soon to move to the new standard.

Is it worth trying to maintain backward compatibility? (i.e. old compiler standard on 32-bit platform)

#3 Updated by John Abbott about 6 years ago

  • Target version changed from CoCoALib-0.99600 to CoCoALib-0.99650 November 2019

#4 Updated by John Abbott almost 5 years ago

  • Target version changed from CoCoALib-0.99650 November 2019 to CoCoALib-0.99700

#5 Updated by John Abbott over 4 years ago

  • Target version changed from CoCoALib-0.99700 to CoCoALib-0.99800

#6 Updated by John Abbott about 3 years ago

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

#7 Updated by John Abbott about 2 years ago

What is the status of this issue?

#8 Updated by John Abbott 4 months ago

  • Status changed from In Progress to Closed
  • Assignee set to John Abbott
  • % Done changed from 10 to 100
  • Estimated time set to 0.77 h

Some time ago we adopted the C++14 standard. Sooner or later we shall jump to C++20 ???
The affected functions are IsPrime_squarable and IsPrime_NotSquarable.
The code looks like it should be safe. I'm pretty sure it compiled without problem on my 32-bit test platform, and that the tests pass.
So I shall close this issue: if someone really wants to make CoCoALib work on a 32-bitter, there may be some extra checking to do. We do not really have resources to maintain 32-bit legacy compatibility... even several Linux distros are dropping 32-bit support (and they have much more manpower than we do).

Also available in: Atom PDF