![]() |
[QUOTE=manasi;462316]1. I need to find out a program that only deals in machine level 0s and 1s. What I mean is unlike C++, Java, etc...decimals are not converted to binary but it is a program where every number dealing is binary.[/QUOTE]
In almost every modern language, certainly including PARI/GP, C++, and Java, [i]all[/i] numbers are in binary unless you go through a lot of extra effort to avoid that (via BCD or other formats). You enter numbers in decimal, but they are stored and processed exclusively in binary and only re-converted into decimal when you output them. [QUOTE=manasi;462316]There should be no fixed integer range so large blocks can be dealt with in a good way.[/QUOTE] This only slightly less common. Some languages like PARI/GP and Python have bignums built-in so you can't reasonably overflow, and many others like C and Java have libraries that can support them as needed. |
[QUOTE=paulunderwood;462328]If you have linux you could use the [URL="https://en.wikipedia.org/wiki/Bc_%28programming_language%29"]bc language[/URL]:
[CODE]bc 1.06.95 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. ibase=2 obase=2 101010*101001 11010111010 [/CODE] I think you can get it for Windows and iPhone :smile:[/QUOTE] Thanks |
[QUOTE=Dubslow;462329]Do you mean something like GMP?
Yes, every language still fundamentally works in binary, but typically in fixed-width binary. GMP is a library for C (and therefore all its derivatives) that allows for arbitrary-size integers. It's very common in big number prime testing and factorization code. [url]https://en.wikipedia.org/wiki/List_of_arbitrary-precision_arithmetic_software[/url] A lot of the languages and software packages in the above list use GMP under the hood.[/QUOTE] Thanks. I learnt about GMP. I was talking about ASCII specifications and space a signed or unsigned int occupies. I will explain in next post. |
I am probably wrong on this, but... Isn't the use of fixed length variables a matter of the machine word length, i.e. hardware stuff, not software stuff?
In other words, the use of decimal, binary, hexadecimal or whatever else is bound to the physical representation of the bits inside the computer registers. This means that a "binary, unbound bit-length language" is something as theoretical as a Turing Machine... |
[QUOTE=CRGreathouse;462332]In almost every modern language, certainly including PARI/GP, C++, and Java, [i]all[/i] numbers are in binary unless you go through a lot of extra effort to avoid that (via BCD or other formats). You enter numbers in decimal, but they are stored and processed exclusively in binary and only re-converted into decimal when you output them.[/QUOTE]
Well, the only problem is there is a certain integer range that is acceptable as space for an integer(signed or unsigned int). There is a problem if you have to check a number like 2^10000019 -1 is prime or not. Most programs can not handle operations with large numbers. Now, suppose I do not want to use Lucas Lehmer test but instead want to create endomorphisms that directly alter blocks of the binary sequence 2^10000019 -1 yielding a result with less operations. For instance, you could rule out division from {multiplication,division,subtraction} but only use {subtraction,multiplication}. There would be very large binary sequences. This is what I want to do to get results a different way. [QUOTE=CRGreathouse;462332]This only slightly less common. Some languages like PARI/GP and Python have bignums built-in so you can't reasonably overflow, and many others like C and Java have libraries that can support them as needed.[/QUOTE] Oh! |
[QUOTE=manasi;462361]
Now, suppose I do not want to use Lucas Lehmer test but instead want to create endomorphisms that directly alter blocks of the binary sequence 2^10000019 -1 yielding a result with less operations. For instance, you could rule out division from {multiplication,division,subtraction} but only use {subtraction,multiplication}. There would be very large binary sequences. This is what I want to do to get results a different way. Oh![/QUOTE] Montgomery multiplication and binary exponentiation? |
[QUOTE=manasi;462361]Now, suppose I do not want to use Lucas Lehmer test but instead want to create endomorphisms that directly alter blocks of the binary sequence 2^10000019 -1 yielding a result with less operations.[/QUOTE]
I don't know why you think it is possible to go faster than LL by working "directly"with binary. All existing programs work directly with binary. |
[QUOTE=manasi;462361]Most programs can not handle operations with large numbers.
[/QUOTE] Depends on what you call 'most'. Excel? calc.exe? [QUOTE=manasi;462361]... This is what I want to do to get results a different way. ... Oh![/QUOTE] In order to get results a different way you first need to read and learn what is already done. Two Russian anecdotes come to mind: 1. "Can you play violin?" -- "I never tried but I think I can!". [SPOILER]This was popular [I]long[/I] before the Kruger & Dunning 1999 paper.[/SPOILER] 2. "Can you play (using a)* violin?" -- "I can! ...But it is very inconvenient - the cards** slip and fall over. Cello is much better." ______________ *In Russian, "to play violin" is a phrase with a preposition. **And of course "play" in most minds means "play cards" |
[QUOTE=ET_;462362]Montgomery multiplication and binary exponentiation?[/QUOTE]
I thought to use endomorphisms and work similar to modular arithmetic - Start to compare size of two binary numbers minus zeroes at the end. Then just play with the blocks using endomorphisms. Different algorithm other than the two you mentioned. But then, as you say, perhaps machine specifies integer width.(hardware) So, I can not proceed on this line. |
[QUOTE=CRGreathouse;462376]I don't know why you think it is possible to go faster than LL [/QUOTE]
No idea if I can go faster. Didn't exactly write and compare the two algorithms. Just wanted to try different. |
[QUOTE=Batalov;462383]
In order to get results a different way you first need to read and learn what is already done. [/QUOTE] Thanks. Very true.(i) I would like to know more about endomorphisms acting on binary sequences. (ii) Are they more/less helpful in factoring? I googled but did not get suitable results. |
| All times are UTC. The time now is 01:40. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.