flat assembler
Message board for the users of flat assembler.

flat assembler > Macroinstructions > [fasmg] Lucas Prime Test

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
bitRAKE



Joined: 21 Jul 2003
Posts: 2778
Location: dank orb
Code:
; is F a factor of 2^N-1
macro MFactorQ N*,F*
        local B,T,D
        D = 1 + bsr F
        B = 1
        T = 1
        while B < N & T
                if (B+D) <= N
                        T = ((T+1) shl D)-1
                        B = B + D
                        T = T mod F
                else
                        T = T + T + 1
                        B = B + 1
                        if T >= F
                                T = T mod F
                        end if
                end if
        end while
        repeat 1,t:T,b:B,f:F
                if T = 0
                        display `f,' divides 2^',`b,'-1.',13,10
                else
                        display '2^',`b,'-1 mod ',`f,' = ',`t,13,10
                end if
        end repeat
end macro

MFactorQ 1001664179, 1878753956886303627167 ; 2 min
MFactorQ 3930621659, 6134708376727152865752497 ; 10 min    

_________________
¯\(°_o)/¯ unlicense.org
Post 17 Feb 2019, 17:57
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2778
Location: dank orb
Is there an a way to terminate the assembly process without producing an error? I don't want an output file, but presently am using "err 'No Output File'".
Code:
test-file.fasmg [66]:
        err 'No Output File'
Custom error: No Output File.
The terminal process terminated with exit code: 1    
I need to prune zero length files from the directory or parse around "no file errors" to find actual errors. Another solution would be to output to NUL, but this too splits the build process. It would be nice to have a solution within the source itself.

Maybe "format null" could not produce a file?

_________________
¯\(°_o)/¯ unlicense.org
Post 27 Feb 2019, 01:27
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2778
Location: dank orb
bitRAKE wrote:
Next I try to verify some data: There is list of cube sums at https://arxiv.org/abs/1604.07746v1
The answer is 42 !

https://www.youtube.com/watch?v=ASoz_NuIvP0

_________________
¯\(°_o)/¯ unlicense.org
Post 13 Mar 2019, 02:00
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.