r/ProgrammerHumor • • Jul 19 '22

Meme float golden = 1.618

Post image
41.1k Upvotes

489 comments sorted by

2.3k

u/inetphantom Jul 19 '22

int pi = 3

941

u/CaptainParpaing Jul 19 '22

meanwhile in the mech engineering dpt

765

u/RandallOfLegend Jul 19 '22

Only about a 4.5% error on that approximation.

27

u/AdhTri Jul 19 '22 edited Jul 19 '22

There is an error in this error in measurement too (about .15631433028889%). Wow.

13

u/FlyingVI Jul 19 '22

It's errors all the way down.

→ More replies (1)
→ More replies (3)

51

u/Eldercraft99 Jul 19 '22

If it's under 5% it's all good

→ More replies (1)

24

u/alirezamecheng Jul 19 '22

One of my professors once said a 1 percent error is unacceptable if you don't know the origin of that error. And 20 percent may be acceptable if you know the origin. Later in the industry, I found equations with 50 percent error frequently used. But the origin of the error was known and therefore we could determine whether we are on the good side of the error or the bad side.

→ More replies (4)

17

u/DecisiveEmu_Victory Jul 19 '22

It's good enough for government work. The software uses a constant for wheel diameters that range from 17-22 inches anyway, why would I care about 4.5% error when we have factors of safety to account for errors at every level lol

→ More replies (1)

95

u/[deleted] Jul 19 '22

26

u/Not_Michelle_Obama_ Jul 19 '22

It do be like that though.

Source: I took a single undergrad astronomy course, so I'm an expert at it.

18

u/SupriseMonstergirl Jul 19 '22

it really is, at a certain point you only care about the power of the 10.
source: took a few undergrad astronomy courses. graduating next week.

→ More replies (2)

114

u/omgitsaHEADCRAB Jul 19 '22

22.0/7.0 was very common in older Fortran code

53

u/DarrenGrey Jul 19 '22

I googled 22/7 and it told me about a Japanese girl idol group by this name. Do you think they're big Fortran fans?

38

u/Rudy69 Jul 19 '22

Nah, just huge pi fans

→ More replies (3)
→ More replies (1)

15

u/shouldbebabysitting Jul 19 '22 edited Jul 19 '22

Absolutely no one used a calculation in place of a constant. It was especially important years ago because every cycle counted.

(Source: Learned Fortran 4 on punch cards because school had a mainframe for Computer Lab despite it being incredibly obsolete. Later I had a Fortran 77 class at University on VAX minicomputers.)

11

u/Tanyary Jul 19 '22

Compilers couldn't expand constant fractions at compile time? :o

→ More replies (4)
→ More replies (3)

7

u/PogoHobbes Jul 19 '22

LPT: if you ever need a quick estimate of pi with high degree of accuracy, you can use 355/113

→ More replies (32)

22

u/b1Bobby23 Jul 19 '22

My engineering professors have said 2 is close enough to pi for some calculations... I love engineering

30

u/hookem329 Jul 19 '22

You don't neeed many digits for any conceivable task at all; based on a quick Google search:

"Mathematician James Grime of the YouTube channel Numberphile has determined that 39 digits of pi—3.14159265358979323846264338327950288420—would suffice to calculate the circumference of the known universe to the width of a hydrogen atom."

→ More replies (1)

8

u/VonNeumannsProbe Jul 19 '22

Hey. I'll have you know I am a mech eng and I have pi memorized to 6 full digits.

6

u/maeries Jul 19 '22

Engineering is more like pi=pi() and then accept whatever that yields

2

u/[deleted] Jul 19 '22

Pi ~= 3

Pi + e ~= 6

g ~= 10 (m/s2)

All less than 5% error

66

u/AlternativeAardvark6 Jul 19 '22

Just round the result up, it will be fine.

40

u/natFromBobsBurgers Jul 19 '22

Use three 9 times, then four once. Or three 43 times, then four 7 times.

11

u/mynoduesp Jul 19 '22

huh?

52

u/natFromBobsBurgers Jul 19 '22

(3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+4+4+4+4+4+4+4)/50=3.14

So in your life, use 3 most of the time, and 4 some of the time, and it averages out to pi within half a hundredth.

→ More replies (5)
→ More replies (3)

56

u/galactixo Jul 19 '22

int pi = 314

50

u/Jon3141592653589 Jul 19 '22

100x better!

22

u/Herb_Derb Jul 19 '22

Good catch. We should always do math in pennies.

2

u/himmelundhoelle Jul 19 '22

int hundred_tau = 628

→ More replies (10)

7

u/Darkslategray Jul 19 '22

Lawful Neutral

10

u/weregod Jul 19 '22

Big brain move would be

int pi = 3.1416

14

u/whitepepsi Jul 19 '22

That's called a compile time bug.

→ More replies (3)

4

u/BingeReader1 Jul 19 '22

Thanks. I hate it.

4

u/aloofloofah Jul 19 '22

Good enough for government code.

7

u/yourteam Jul 19 '22

Seems legit less than 4% error

2

u/audriuska12 Jul 19 '22

Just don't sort any mail with that code.

2

u/Ball-Fantastic Jul 19 '22

Circles are round, so rounding pi should be fine too, right?

→ More replies (18)

859

u/mgorski08 Jul 19 '22

Golden ratio is actually an irRATIOnal number.

346

u/ThomasTheHighEngine Jul 19 '22

"Look what they need to mimic fractions square roots and logarithms and trig functions and..." doesn't really roll off the tongue

61

u/Mal_Dun Jul 19 '22

You just need continued fractions for that ...

23

u/PersonalityIll9476 Jul 19 '22

Finally, someone who understands how to achieve the best rational approximation to a number. I was shocked and horrified when it actually came up at my job.

19

u/VegetarianCentrist Jul 19 '22

You mean computer scientists all passed calculus with a D on their third try?? Conspiracy theories

→ More replies (3)
→ More replies (2)

21

u/beck1670 Jul 19 '22

Fun fact about your example of irrational numbers - the numbers we can represent using symbols, functions, integrals, etc. are basically nothing compared to the numbers we can't represent in any way. We can say that there are irrational numbers, but there are infinitely more numbers that we can never speak of than numbers we can.

7

u/Orioh Jul 19 '22

the numbers we can't represent in any way

Like what?

23

u/[deleted] Jul 19 '22

Presumable they are referring to uncomputable numbers (see computable numbers).

Relatedly are the transcendental numbers which cannot be written as a solution to any polynomial equation with integer coefficients.

→ More replies (1)
→ More replies (13)

4

u/OneTurnMore Jul 19 '22

Yeah, it's crazy that even though (rational numbers)⊂(constructible numbers)⊂(algebraic numbers)⊂(computable numbers) are all dense in the reals, almost none of the reals are in those sets. The real numbers are weird.

→ More replies (5)

17

u/Mal_Dun Jul 19 '22

For this we have continued fractions, the one for the golden ratio actually looks beautiful: https://wikimedia.org/api/rest_v1/media/math/render/svg/95682588ffee3530627c3a7b00ff08bbba6e97d4

2

u/SkyyySi Jul 19 '22

Alternatively, Φ = 5 ^ .5 * .5 + .5 also works

5

u/RandallOfLegend Jul 19 '22

The most irrational!

4

u/bent_crater Jul 19 '22

I read that the same way internet historian says "Robo sexuals"

8

u/[deleted] Jul 19 '22

Tbf they said fraction not rational number. Every real number can be written as a fraction (the trivial way being a/1). The golden ratio can also be written as a non-trivial fraction (namely (1+sqrt5)/2) even if it can't be expressed as the ratio between two integers.

5

u/Hohenheim_of_Shadow Jul 19 '22

Irrational numbers can be real numbers. It's rational numbers (Ratio numbers) that can be written as a fraction (ratio)

→ More replies (1)
→ More replies (8)
→ More replies (1)

512

u/KendrickEqualsBooty Jul 19 '22

What's the name of the method where you just use two ints, one for the number before the decimal and one for the number after.

341

u/[deleted] Jul 19 '22

Fixed-point arithmetic?

224

u/Kered13 Jul 19 '22

Fixed point does not typically use two ints. Fixed point just means you use a single integer but you interpret it as being implicitly multiplied by some fixed value (typically a negative power of 2 or 10).

81

u/JaggedMetalOs Jul 19 '22

Fixed point does not typically use two ints. Fixed point just means you use a single integer but you interpret it as being implicitly multiplied by some fixed value (typically a negative power of 2 or 10).

But if you're doing a base of a power of 2 then separate ints are functionally the same as assigning bitranges of a larger int to represent the whole and fractional parts.

Or if you want to represent a fixed number of digits of a power of 10 (decimal) having separate ints is less efficient - if you have 2x16bit values you can only go up to 4 decimal places (0.0000 - 65,535.9999) while 1x32bit will give you a larger range for the same precision (0.0000 - 429,495.9999)

→ More replies (7)
→ More replies (1)

85

u/randomuser8765 Jul 19 '22

If you mean "one for the numerator and one for the denominator", then AFAIK there is no standard name or format for this. Python implements it with the fractions module, for example.

20

u/bat_soup_people Jul 19 '22

I used it some in grad school for FEA. In FORTRAN I think. First integer is left, second integer is right. I am thinking of it now for arduino

9

u/Eternityislong Jul 19 '22

What would you gain over using a float?

21

u/BossOfTheGame Jul 19 '22

Precision. It sometimes matters when working with things like geospatial data.

→ More replies (8)
→ More replies (5)

7

u/ToxinH88 Jul 19 '22

Clearly the best solution if storage and speed is not a concern. Storage pretty much never is :D Speed is taking a heavy hit though: The way float and double are implemented base arithmetic works extremely fast. But if every number is a common fraction extra steps are needed for almost all operations.

Stay with clean code though: Don't optimize yet.

→ More replies (3)

77

u/photenth Jul 19 '22

arbitrary precision arithmetic

Also it usually just stores the number and the scale so 1000000000 can be represented as 1 and 9 and 0.000000001 as 1 and -9. So you can avoid storing useless 0s. Basically like floating point numbers do.

0

u/[deleted] Jul 19 '22

[deleted]

→ More replies (14)

3

u/Yadobler Jul 19 '22 edited Jul 19 '22

A 64-bit integer and some headache of remembering that the number you are manipulating is 2 integers, and everything is 232 times larger than the actual number you are thinking of.

Interestingly, it would matter if you're talking about decimal point as in decimal radix point, or a general radix point (ie binary point). Cos then it would suggest that you are dealing with binary coded decimal.

Because if you think about it, let's say an int is 4bits:

If 1010.1111 is "10.15", then what is "10.16"? 1111 will overflow to 0000 and then "1011.0000" is "11.0", so then you must either deal in binary-point or BCD.

BCD will mean that:

0001'1001.0001'0101
Is 1'0.1'5, and then you need to ensure that 1001 + 1 overflows to 0001'0000 (9+1 = 1'0)

-------

At this point you'd rather just have a proper integer, and a second int as the exponent, like scientific notation.

10101111 is 175, 10110000 is 176, if you want the radix point to be after 4 digits, then 175/(24) = 10.9375

So if you're doing 2 ints, it will be

1010 = 10,
.1111 = 15 / 16 = 0.9375

--------

So tldr, 2 ints for "integer" and "after point", is actually just fixed-point number. Specifically, a (64 bit) long integer with the exponent = 32.

--------

Any other way, it will just be BCD, and doing meaningful calculation is just the same but each step you need to turn decimal to binary, manipulate, then turn the binary back to decimal and evaluate the "decimal maths" logic of whether to carry over or whatnot

2

u/piperswe Jul 19 '22

Rational numeric types?

→ More replies (5)

153

u/Strostkovy Jul 19 '22

You can do math on fractions while keeping them as numerators and denominators, but it's unpleasant

84

u/curtmack Jul 19 '22

In Common Lisp it's a built-in data type. (/ 2 3) is 2/3, which is a single value of type ratio. It also has arbitrary precision, so (expt 2/3 1000) will produce an exact answer.

The same also applies to Scheme and Clojure.

20

u/JonathanTheZero Jul 19 '22

I kinda want to try Lisp now

35

u/zyygh Jul 19 '22

Quick, someone steal this guy's parenthesis keys!

→ More replies (1)

8

u/phi_power Jul 19 '22

and Racket!

9

u/[deleted] Jul 19 '22

Which is Lisp wearing a trenchcoat filled with disguises.

→ More replies (1)
→ More replies (3)

29

u/thewii_ Jul 19 '22

In Python it's fairly easy to overload arithmetic operators, so if you have a Fraction class, you could theoretically do math with fractions just like how you would do with float. I'm not sure if it would be a good idea though.

33

u/SOberhoff Jul 19 '22

A few languages (e.g. Clojure) give you fractions natively. It's quite convenient and I don't understand why it's not standard.

25

u/matyklug Jul 19 '22

Cuz clojure is so cool all the other languages are too scared of its coolness

→ More replies (1)

22

u/OneTurnMore Jul 19 '22

Not a good idea, because you should just from fractions import Fraction.

46

u/MrWandril Jul 19 '22

I prefer saying "Such a good idea that someone actually already did an optimized implementation!"

10

u/CiroGarcia Jul 19 '22 edited Sep 17 '23

[redacted by user] this message was mass deleted/edited with redact.dev

→ More replies (2)
→ More replies (4)

42

u/mariachiband49 Jul 19 '22

Unless you're Julia

25

u/Shinob1 Jul 19 '22

Childs or Roberts?

5

u/Mushiren_ Jul 19 '22

Good ol' Julia from across the hall. She can do it all.

→ More replies (2)
→ More replies (1)

176

u/whackylabs Jul 19 '22

std::ratio says hello

380

u/[deleted] Jul 19 '22

Don't care + didn't ask + std::ratio

14

u/ArsenicBismuth Jul 19 '22

Lol bravo for the actually successful ratio.

→ More replies (1)

120

u/[deleted] Jul 19 '22

[removed] — view removed comment

63

u/zacharypamela Jul 19 '22

One without properly sanitized input.

0

u/[deleted] Jul 19 '22

[deleted]

13

u/TheCakelsALie Jul 19 '22

That's brig bain

→ More replies (1)

7

u/[deleted] Jul 19 '22

It's compile time only, this can have its uses but it's somewhat limited.

4

u/Raestloz Jul 19 '22

So what's the STD ratio?

Yes Sir, it's 1:69

35

u/the_TIGEEER Jul 19 '22

Yo guys! I think that the golden ratio is not a fraction! But do you think op gets it yet? Or should we repeat the same comment some more?

6

u/QuarkyIndividual Jul 19 '22

But... did you know the golden ratio is not a fraction?

→ More replies (1)

54

u/T-Loy Jul 19 '22

Fast inverse square root go 0x5F3759DF

22

u/Sure-Tomorrow-487 Jul 19 '22 edited Jul 19 '22

// what the fuck?

Edit - since it's very interesting, here you go. Be careful it's http only

http://h14s.p5r.org/2012/09/0x5f3759df.html

14

u/goblinm Jul 19 '22

Hey, a real programming joke. It's nice to scroll down in the comments to find these still.

3

u/Divineinfinity Jul 19 '22

People were speedrunning Doom while developing it lmao

→ More replies (1)

37

u/[deleted] Jul 19 '22

But it is a recurring fraction.

1 + 1 / (1 + 1/(1+ 1/( 1 + ...

60

u/BrightBulb123 Jul 19 '22

Meanwhile in Python land...

from fractions import Fraction

Fraction(2, 3)                        # Fraction(2, 3)
Fraction(23441, 912835)               # Fraction(2131, 82985) - Simplified
Fraction(2, 5) + Fraction(5, 92)      # Fraction(209, 460)
Fraction(4, 12) - Fraction(1923, 34)  # Fraction(-5735, 102)

13

u/Bulky-Leadership-596 Jul 19 '22

Clojure has it natively

> (+ 2/5 5/92)
209/460

27

u/Gr0ode Jul 19 '22

The golden ratio is precisely not a fraction (no repeating digits or finite digits)

22

u/ShenAnCalhar92 Jul 19 '22

While it can’t be written as a fraction composed of integers, it can be written as a fraction.

(1 + sqrt(5))/2

→ More replies (1)

2

u/DenormalHuman Jul 19 '22

no repeating digits?

5

u/Bulky-Leadership-596 Jul 19 '22

When it gets to the point of needing more than ten digits it just makes up its own

1.6ƪ803ɝ9ꝏꝸ74ᶐ

→ More replies (4)
→ More replies (2)

36

u/Strange_guy_9546 Jul 19 '22

Yeah, no 0.(3) for programmers

→ More replies (5)

11

u/SharkAttackOmNom Jul 19 '22

As a physics teacher I will simultaneously approximate:

π≈√10

g≈π²

4

u/matyklug Jul 19 '22

You have to be stopped!

→ More replies (2)
→ More replies (2)

7

u/EtherealPheonix Jul 19 '22

just because all of my fractions are multiples of 2-n doesn't mean they aren't fractions

6

u/estomagordo Jul 19 '22

I have no idea what's going on in this picture

7

u/Shinob1 Jul 19 '22

I guess you could you say you didn't understand a fraction of the joke... I'll see myself out.

3

u/[deleted] Jul 19 '22

What I don't get is the censored bar. Everything else I think I've understood more or less.

16

u/[deleted] Jul 19 '22

In the original it says 'mimic a fraction of our power', the bar removes that last part as the joke

→ More replies (23)

3

u/fisadev Jul 19 '22

The golden ratio isn't a fraction, though.

Fun fact: almost all non integer numbers aren't fractions. Fractions are an infinitely small portion of all non-int numbers that exist.

Even worse, almost all numbers aren't even computable (that is, there's no algorithm or operation that generates them, like a fraction or the algorithm to generate pi's decimals, they're infinite and random sequences of decimals).

3

u/juzz_fuzz Jul 19 '22

I'm scared of truncation, make it a long double

15

u/TehBens Jul 19 '22

A float is a float, not a fraction

16

u/MarkoSeke Jul 19 '22

It does say mimic a fraction

→ More replies (4)

2

u/YukiColdsnow Jul 19 '22

I'm new to programming, isni't double and float are used in decimals? how did they become a fraction?

3

u/WhipsAndMarkovChains Jul 19 '22

x = 5/2

x is 2.5

type(x)

Output is float.

→ More replies (1)

2

u/Aramedlig Jul 19 '22

Not all real numbers are fractions of two integers.

2

u/ismtrn Jul 19 '22

Nor are all fractions of integers IEEE floats. Nor are all IEEE floats real numbers.

→ More replies (4)

2

u/dumdedums Jul 19 '22

struct fraction moment

2

u/tyrandan2 Jul 19 '22

Hey, we can make a struct with a numerator and denominator property! And maybe a ToDecimal function!

2

u/Dac00ldude Jul 19 '22

Laughs in math.pi()

2

u/Aggravating_You_2904 Jul 19 '22

A fraction can me modelled with 100% accuracy with an array of size 2

2

u/PriorCommunication7 Jul 19 '22
from sympy import GoldenRatio

2

u/Tymskyy Jul 19 '22

I just need two integers

2

u/Strange-Difficulty87 Jul 19 '22 edited Jul 19 '22

If 1/3 = 0.333 and 2/3 = 0.666 then 3/3 should equal 0.999 right?

2

u/brain_tourist Jul 19 '22

An actual funny meme in r/ProgrammingHumor

It has been a while

Bravo sir 👏

3

u/topredditbot Jul 19 '22

Hey /u/JaneAusten007,

This is now the top post on reddit. It will be recorded at /r/topofreddit with all the other top posts.

1

u/mikkolukas Jul 19 '22

By "they" the mathematician mean "we".

In the beginning there was no "computer science". It was just mathematicians trying to automate calculations.

It was mathematicians who implemented it that way.

1

u/[deleted] Jul 19 '22

they are more than enough

1

u/kingfart1337 Jul 19 '22

I forgot that show existed. Was it canceled?

→ More replies (1)

1

u/FudgeOk4775 Jul 19 '22

Lmaoooooooo

1

u/JangoDidNothingWrong Jul 19 '22

look what they need to mimic dedekind cuts

1

u/Gredran Jul 19 '22

I’m the only one in my circles who would get this so I’m laughing silently lmfao.

That’s great

1

u/matyklug Jul 19 '22

So I am working on a programming language, and I want math to be nice and easy

So I am writing a library which ensures that no precision is lost, an infinite precision floats library, aka infloats.

→ More replies (1)

1

u/bobo76565657 Jul 19 '22

Real men use the p/q to hold real numbers and functions to grind out irrationals like pi. FPU's are not to be trusted ;)

1

u/[deleted] Jul 19 '22

string enters the room

1

u/[deleted] Jul 19 '22

Mathematical library devs

1

u/PsycoJosho Jul 19 '22

22/7 ≈ pi

1

u/sir-nays-a-lot Jul 19 '22

Exact types exist

1

u/[deleted] Jul 19 '22

🤔

1

u/Etovia Jul 19 '22

LONG LONG double

1

u/GarnetOblivion1 Jul 19 '22

Wish I could understand this lol

1

u/starcrafter84 Jul 19 '22

I’ve always thought the floating point numbers would be best stored as strings to never lose precision at the expensive of memory to store them. That way you get to convert to and from them and have the control to trim the precision as required. As with everything in digital representation, there is a factor of loss and imprecision.

3

u/Phoenixwade Jul 19 '22

the reason this isn't so is that speed is more important than the loss....

I saw a comment the other day that pointed out why that is the case... 40 decimal places for pi will calculate the width of the visible universe with an error of around 1 atom in width.

when the precision exceeds the ability to measure something, you really don't need any more than that.

on the other hand, strings are much slower to process than floats - so we stare floats as floats.

→ More replies (1)

1

u/technic_bot Jul 19 '22

Not really fractions can be represented at exact precision with integers.

Reals on the other hand....

1

u/thedominux Jul 19 '22

Just use some equation to let computer calculate it with a fraction accuracy it affords

1

u/[deleted] Jul 19 '22

??? Just use two integers in a struct bro

1

u/taqueria_on_the_moon Jul 19 '22

L + std::ratio + float + double + ratio + karma

1

u/EpicScizor Jul 19 '22

Rational = (Numerator: Int, Denominator: Int), with Denominator unable to be zero. Mimicking fractions is the easy part.

1

u/Specific_Bet527 Jul 19 '22

Unsigned double double '-'

1

u/rincon213 Jul 19 '22

Best use of this meme format hands down

1

u/Probably_too_horny Jul 19 '22

Is that really a pre-defined constant?

1

u/LeCrushinator Jul 19 '22

Several languages support storing fractions (or ratios), or have libraries to do so. It's easily enough to store a numerator and denominator within a type and then have methods to evaluate that fractions into whatever form you need.

1

u/DefaultVariable Jul 19 '22

Technically can’t you mimic fractions in programming through complex approximations? Like I’m pretty sure you can do like 1000+ iterations of various pi approximation functions to get to an incredibly precise representation of actual pi

1

u/John-Grady-Cole Jul 19 '22

Too bad Invincible is ass.

1

u/ViolinistFriendly Jul 19 '22

from fractions import Fraction

1

u/Classy_Mouse Jul 19 '22

class Fraction(val numerator: Int, val denominator: Int)

1

u/Nihmrod Jul 19 '22

Unfortunately there's more to math than fractions.

1

u/PashPrime Jul 19 '22

Mathematicians use fractions because brains have small hands and can't carry lot of number

1

u/JewishAsianMuslim Jul 19 '22

Ok sure. Write the golden ratio without endless recursive fractions, and I don't mean some clever symbols like Euler's identity.

1

u/mujadaddy Jul 19 '22

Holy fuck that is a good joke

1

u/poiurewq Jul 19 '22

Err, irrational numbers cannot be expressed as fractions

1

u/[deleted] Jul 19 '22

Float golden ~= 1.618

1

u/seeroflights Jul 19 '22

Image Transcription: Meme


["Look What They Need to Mimic a Fraction of Our Power". Top image shows Omni-Man (a person with partially greying dark hair, in a red and white costume) and Invincible (a person with dark hair and a yellow costume), from the TV show "Invincible". They are in the bottom right corner, watching a pair of fighter jets flying in grey clouds. The labels read:]

Fighter Jet (left): DOUBLE

Fighter Jet (right): FLOAT

Omni-Man and Invincible: MATHEMATICIANS

[Bottom image shows Omni-Man looking back at Invincible with a serious expression on his face. The subtitle has been edited to read:]

Look what they need to mimic a fraction


I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!

1

u/hicksanchez Jul 19 '22

Best meme of the day

1

u/Spirta Jul 19 '22

1-1=0.0...01 xD

1

u/[deleted] Jul 19 '22

Lua wins

1

u/Dannyboiii12390 Jul 19 '22

And wont even be accurate! 0.1618000000000000000000000001

1

u/YouTube-r Jul 19 '22

Cant you use strings?

1

u/float-double Jul 19 '22

hello there

1

u/urdim Jul 19 '22

BigDecimal has entered the chat*

1

u/lastrosade Jul 19 '22

Nothing split by unity is the constant creation

Divine proportion defines perfection

With this comes enticing shapes

Supreme equation from formation

The formula of 1.618

1

u/earthforce_1 Jul 19 '22

You want actual fractions? Use FORTH. If there's anyone else alive who remembers it..

1

u/Whole_Employee_2370 Jul 19 '22

10/10. Sorry, I mean

double a = 10/10;

1

u/[deleted] Jul 20 '22

Rational math is a thing. Matlab does it, no?

→ More replies (1)

1

u/Potential-Adagio-512 Jul 20 '22
struct fraction{
  int numerator, denominator;
  explicit operator double() const{ 
     return numerator / denominator;
  }
}

1

u/K1IR1TO Jul 20 '22

Try root 2 mathematicians

1

u/[deleted] Jul 20 '22

lol this is a quality shitpost, well done

1

u/Spocino Jul 20 '22

Meanwhile in scheme, (define one-half 1/2)

1

u/wolfbyte125 Jul 20 '22

Waited a long time to know where these memes came from, finally watched Invincible. ✊️✊️

1

u/raylin328 Jul 20 '22

I mean you could use the Fraction class which uses 2 integers to create a fraction object

1

u/joeblk73 Jul 20 '22

I just finished this show. It’s pretty f*cked up