Jump to content

Long multiplication: Difference between revisions

(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 3,178:
2^128 = '{def p128 {mul {p64} {p64}}} -> '{p128} = 340282366920938463463374607431768211456
 
5) a more effective implementation
This can be tested in http://lambdaway.free.fr/lambdaspeech/?view=numbers8
 
Lambdatalk can be helped by the lib_BN javascript library from Jonas Raoni Soares Silva
and stored in a wiki page called by a {require lib_BN} command, computing becomes fast:
 
2^32 = {def p32 {BN.pow 2 32}} -> {p32} = 4294967296
2^64 = {def p64 {BN.* {p32} {p32}}} -> {p64} = 18446744073709551616
2^128 = {def p128 {BN.* {p64} {p64}}} -> {p128} = 340282366920938463463374607431768211456
 
This can be tested in http://lambdaway.free.fr/lambdaspeech/?view=numbers8
</lang>
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.