DEV Community

Cover image for Printing floating point numbers with Gargi Sharma

Printing floating point numbers with Gargi Sharma

Gargi Sharma on July 23, 2020

I am a software engineer who contributes to OCaml open source at Tarides. Previously, I worked at Bloomberg, Uber, and eBay. I also attended the Re...
Collapse
 
ben profile image
Ben Halpern

There is so much I really don't understand about this subject. Already learning some stuff in the first couple mins 😄

Collapse
 
alephthoughts profile image
Abhishek Sharma • Edited

My favorite demo on importance of machine epsilon:

~
def f(x):
if x <= 1/2:
return 2 * x
if x > 1/2:
return 2*x - 1

x = 1/10
for i in range(80):
print(x)
x = f(x)
~

Collapse
 
terceranexus6 profile image
Paula

This is so interesting, so cool to better understand how maths work under the higher programming levels we are used to work with! thank you to take the time to explain to us! loving it

Collapse
 
joshuaburke profile image
Dangeranger

Fun fact, there are more numbers between 0 and 1, than there are integers above 0.

Collapse
 
omarkhatib profile image
Omar

Thanks , Every computer scientist out there including me will be happy to watch this!

Collapse
 
andy profile image
Andy Zhao (he/him)

I wonder why they're all dragon related haha

Collapse
 
gs0510 profile image
Gargi Sharma

I think it's a tribute to the first algorithm! The first one was called Dragon4 because of the Dragon curve and the folds & peaks in the making of a dragon curve and others followed tradition. :)

Collapse
 
andy profile image
Andy Zhao (he/him)

Ahh that makes sense! Interesting!

Collapse
 
lindakatcodes profile image
Linda Thompson

Good job! I never really thought about computers doing floating point math based in binary instead of decimal.....no wonder it always works so weird!!

Collapse
 
tfrick47 profile image
Terri Fricker

So excited. I've just run into this and I was so confused!

Collapse
 
spicyc profile image
SpicyC

Love the folded paper representation of dragon f, p, f, p.... makes logical sense - Thank you :)

Collapse
 
spicyc profile image
SpicyC

Technical Support Question: Every time I select 'checkin' in takes me to purchase ticket page and says I already have a ticket....??

Collapse
 
nicolehopkins7 profile image
Nicole Hopkins

I haven't figured out how to check in either!

Collapse
 
tfrick47 profile image
Terri Fricker

Wonderful!

Collapse
 
esmeesamarripa profile image
Esmeralda Samarripa

This was extremely interesting! It amazing to realize how much more we have left to really learn in this subject.

Collapse
 
tfrick47 profile image
Terri Fricker

For Gargi,

I'm surprised that the math was so difficult since the internet starting with sharing scientific papers.

Collapse
 
koddr profile image
Vic Shóstak

Wow, cool :D

Collapse
 
tfrick47 profile image
Terri Fricker

Could Brian give us a few links to start our search for security tools for websites?

Collapse
 
tfrick47 profile image
Terri Fricker

Heidi, I love that you entered the computer world through interacting with people.

Collapse
 
imaginativeone profile image
Doug Franklin

Loving this topic!

Collapse
 
imaginativeone profile image
Doug Franklin

Josh Puetz - loved your presentation.