Skip to content
TrackPodcasts
educationJul 18, 201818:01pending

132: Dealing with Money in programming

About this episode

In this mini fragment Kaushik talks about dealing with the Money object. With money we need decimals, but the obvious solution of using a float or double may not work as advertised. Listen to this episode to find out why and how you can go about dealing with this.

Show Notes

Problematic snippet 1:

println(1.03-0.42) # prints 0.6100000000000001

Problematic snippet 2:

var x = 0F
(1..100).forEach { i ->
    x += 0.01F
}
println(x) # 0.99999934 vs 1

Sponsors

  • Bitrise - Bitrise is your mobile continuous integration and delivery for your whole team, with dozens of integrations for your favorite services.

Contact

Get every episode summarized

Each time Fragmented - AI Developer Podcast publishes, we email you a written briefing from the transcript — the topics, who appeared, and any specific claims, with the ad reads skipped.

Email me new episodes

Free for 3 shows. No card needed.

Hosts & guests

No transcript yet

This episode has not been transcribed. Request it and it moves to the front of the queue.

132: Dealing with Money in programming

Fragmented - AI Developer Podcast

0:00
18:01

More episodes

More from Fragmented - AI Developer Podcast

View all episodes →