- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am a bit lost.
The RSA standard defines a block - I assume it can hold numbers as shown on
https://en.wikipedia.org/wiki/ASN.1
A picture of the format is shown below:
I am trying to work out what is the largest integer available in this format string?
I think I am looking at a 14 digit number? But I am not sure?
Anyone ever worked with this format?
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
John,
Consider the following
! set = float(prime)/100.0 ! effectively shift right two decimal places
! ! *** 1.0/100. does not produce an exact binary fraction
! setL = floor(set) ! keep the integer part
! set = (set-setL) * 100 ! produce what were the least significant two digits of prime
! replace the above with
set = mod(prime, 100)
And then consider removing the silliness of using floating point numbers.
Note, line 2 can (will at times) produce an inexact result and thus resulting in line 5 producing the incorrect value.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the idea, I should have thought of it, but that is the beauty of peer review, it keeps you modest, maybe.
I fixed the code although it is running at the moment to do 10 million primes.
do while(flag ==0)
read(file1,*, err = 200, end = 200)numb,ind
cnt = cnt + 1
11 format(i2,1x,i1)
if(ind == 0) then
prime = numb
flag = 1
ind = 1
set = mod(prime, 100)
if( set >= 0 .and. set < 100) then
nums(set) = nums(set) + 1
end if
end if
write(file3,10)numb,ind
10 format(i0,1x,i0)
end do
My daughter wanted to go shopping in Houston today with her friend. We are passing a building with a big number sign in red, 3033, she said I like the sign, I said it is not prime and I only like prime numbers, she said three factors, 3, 9 and 1011, I was surprised and said nine, not likely. High school maths teaches a lot these days. "But she was correct, 9 and 337.
There is a significant speed difference between debug ifort and release ifx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Should numb (aka prime) always be .ge. 0 then mod(prime, 100) will always be .ge. 0, then the if test will always be true. IOW lines 10&12 are unneeded.
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »