ProgrammerHumor

okSureButWithAdditionalSteps

okSureButWithAdditionalSteps
https://i.redd.it/dmvr7fy308df1.jpeg
Reddit

Discussion

yo_wayyyy

bro is colossal

6 hours ago
bassguyseabass
:cp:

Bro exceeds INT32_MAX

5 hours ago
IbaJinx

Bro that’s DJ Khaled

6 hours ago
frosty7even

Suffering from overflow

3 hours ago
yo_wayyyy

i refuse to believe 

5 hours ago
Jugales

Legends foretold the coming of Huge Endian

4 hours ago
4n0nh4x0r
:js::p::cs::cp::bash:

just store the numbers as binary string uwu

no need to care about cpu architecture ever again.
need a 6827891 bit number? sure, just set up your string and get working

6 hours ago
Traditional-Board-68

And what about mathemetical operations like add and subtract, do string operations on them?

5 hours ago
4n0nh4x0r
:js::p::cs::cp::bash:

i mean, this is somewhat how bigInt works, just that it works with decimals instead of binary.
but yea, you make a class, define an add and subtract method, then then does an index by index addition/subtraction, and then returns the value in the end or updates the value in the object directly.

it obviously isnt as efficient as working with normal ints and so on, but it gets the job done in situations where you need extremely large numbers as you arent bound to 32 or 64 bit anymore.
added bonus, it works on every platform.

5 hours ago
Ronin-s_Spirit
:js:

No bigfloat yet, even though it's extremely easy if we're willing to make the same math operations tradeoff.

5 hours ago
4n0nh4x0r
:js::p::cs::cp::bash:

i would go as far as to say, the main use case for bigInts is when you are doing RSA for example, calculating with massive exponents and so on.
as for floats/doubles, i suppose those just arenr as useful to make them a default thing.
but yea, functionality wise, they would work the same way

5 hours ago
Traditional-Board-68

I know how bigint works, but you don't use it everywhere , because each operation requires karatsuba and fft. While using computer architecture to solve arithmetic operations is better for integer because each bit operation is done together. Hence we work on integers not on bigint unless necessary.

5 hours ago
4n0nh4x0r
:js::p::cs::cp::bash:

well yea, they are very inefficient, as such their usage is pretty limited.

One such use case would be RSA for example, with the MASSIVE exponents that you use to generate keypairs.

4 hours ago
Malazin

Just concatenate the operation into the string.

1 hour ago
oshaboy
:py:

Store it as a decimal digit string like Cobol. You can even save memory by using only 2 digits for the year.

4 hours ago
an_0w1
:asm::cp::rust:

I was writing some assembly not too long ago where I needed to do 64bit adds in 32bit code. This is where I leaned that x86 has instructions for arbitrary precision arithmetic.

5 hours ago
oshaboy
:py:

It has add carry and extending multiplication. arm also has those.

4 hours ago
lbp22yt
:cp::lua::gd:

processor explodes

5 hours ago
Rhoihessewoi

Some years ago I needed/wanted 64 bit variables at a 8 bit PIC microcontroller...

I had to use another compiler for that, but then it worked.

3 hours ago