BigDecimal
BigDecimal e metodi di arrotondamento
After seeing the great success of introductory article on BigDecimal class I wanted to go on with some examples on one of the most complex operations: division.
The problem...
Is always the same: length :)
- dimitri's blog
- Aggiungi un commento
- Leggi tutto
- 745 letture
- Italian
Impossible Math
Can we trust computers calculations?
Introduction
IEEE 754 specification is the standard used for floating-point calculations in the engineering and scientific fields. In my humble opinion it is a perfect example of how computer industry and software development are based on a fundamental illusion of mankind: the possibility to attain and manipulate infinity (infinitely small, infinitely big, it doesn't matter).
- dimitri's blog
- Aggiungi un commento
- Leggi tutto
- 472 letture
- Italian
BigDecimal
java.math.BigDecimal class represents “Immutable, arbitrary-precision signed decimal numbers” (with some limits), and has methods to operate on those numbers. Its use although is not so immediate and it is easy to do errors.
In this article I'll try to put some light on this topic, in the hope of seeing a lowering in the amount of bugs related to code using BigInteger and BigDecimal.
- dimitri's blog
- Aggiungi un commento
- Leggi tutto
- 1362 letture
- Italian
Calcoli impossibili
È possibile dubitare dei calcoli di un computer ?
- dimitri's blog
- Aggiungi un commento
- Leggi tutto
- 1096 letture
- English
BigDecimal
La classe BigDecimal consente di utilizzare numeri a precisione decimale "arbitraria" (vedremo poi i limiti di questa definizione) e di eseguire calcoli aritmetici su di essi. Il suo utilizzo tuttavia non è immediato ed è facile commettere errori.
In questo articolo si cercherà di fare un po' di chiarezza sull'argomento, nella speranza di vedere diminuire la quantità di bug nei programmi che usano BigInteger e BigDecimal.
- dimitri's blog
- Aggiungi un commento
- Leggi tutto
- 3975 letture
- English
BigDecimal e metodi di arrotondamento
Visto il grande successo dell'articolo introduttivo sulla classe BigDecimal ho deciso di proseguire la serie con qualche esempio su una delle operazioni più complesse: la divisione.
Il problema...
...è il solito: le dimensioni :)
- dimitri's blog
- Aggiungi un commento
- Leggi tutto
- 3610 letture
- English

