Tag Java

Tag Java RSS 2.0 Feed

Building a Gradle Docker image

I like to use Gradle as building tool for my Java Open JDK projects. Unfortunately is there no official image available on Docker Hub. That is why I started to build my own Gradle image.

Continue reading

Run Java command line in Docker containers

I try to avoid installing specific versions of programming language interpreters and compilers on my operating system. Project A has other requirements as project B or C and the software stack on my operating system gets more and more confusing. Luckily is it possible to run the most command line based things in a Docker container. I will try to compile and run a small Java program in a Docker container.

Continue reading

Inaccurate rounding with decimal digits

I made a small post about Inexact rounding up or down with decimal digits. But it is also possible to run into the same bug when rounding floating point numbers to the next number with restricted decimal digits. A really common example is the price calculation. You have the price 1.99 for example and the tax is maybe 19%. The resulting price with tax would be 2.3681. So you will need to round the price with two decimal digits to 2.37.

Continue reading

Inexact rounding up or down with decimal digits

Calculations with floating point numbers are often producing small hidden bugs in some programming languages. For example rounding down or up with decimal digits. I want to show on some small examples in Java, JavaScript, Python and C the main problem.

Continue reading