Project

General

Profile

Feature #1684

RandomNBitPrime - new fn

Added by John Abbott about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
New Function
Target version:
Start date:
07 Jun 2022
Due date:
% Done:

100%

Estimated time:
0.80 h
Spent time:

Description

Add a new fn RandomNBitPrime(n) which gives a uniform random prime in the range 2^(n-1) to 2^n.
The trouble with RandomSmallPrime is that it can generate "annoyingly small primes".

History

#1 Updated by John Abbott about 2 years ago

  • Status changed from New to Feedback
  • Assignee set to John Abbott
  • % Done changed from 0 to 90

I have a first version... needed by a student.
A quick test suggests that it works fine. Really I just copied the code for RandomSmallPrime and made a few changes.

Will check in soon.

#2 Updated by John Abbott almost 2 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100
  • Estimated time set to 0.80 h

This was completed about 2 months ago. There is even doc!
Not sure how one could test it: perhaps range check and IsPrime check?
Maybe I'll one...

Also available in: Atom PDF