ScratchData LogoScratchData
Back to ChatUser2's profile

Modular arithmetic calculator

CHChatUser2•Created December 19, 2016
Modular arithmetic calculator
3
4
57 views
View on Scratch

Instructions

Ideal project for ciphering. Always gives the result if possible, but never the wrong one. Get your cryptography done fast! Warning: Going over 94906265 module may result in incorrect results except for addition and subtraction. (it won't in *, ^, ^2, ^3 or ! if the real result without modding doesn't exceed 9007199254740992) I also don't recommend going over 200000 as it gets slow with /, ^, sqrt, cbrt and !. I recommend exploring 65537. Available operations: +, -, *, /, ^, sqrt, ^2, cbrt, ^3, ! (last 5 apply to the first number) /, sqrt and cbrt operations are calculated by brute force, so larger modules get slower with them unless the result is small (e.g. sqrt(4)). ^ and ! also can get slow with larger modules as it's calculated iteratively (to prevent accuracy loss) unless second number is small in ^ or the first number is small in !. Prime modules can calculate all divisions except for dividing by 0. Composite modules can't calculate some divisions that are dividing by its divisors or numbers divisible by them. Some primes are 2, 3, 5, 7, 11, 13, 17, 31, 101, 127, 257, 8191, 65537, 131071, 524287 and 2147483647. Of these, 7, 17, 31, 127, 257, 8191, 65537, 131071, 524287 and 2147483647 even have the square root of 2! In fact, all Mersenne primes avoiding 3 in the way do. In module 55441, you can calculate the square root of a lot of numbers! Also, primes don't have factorials that result in 0.

Project Details

Project ID137323869
CreatedDecember 19, 2016
Last ModifiedDecember 22, 2016
SharedDecember 20, 2016
Visibilityvisible
CommentsAllowed