Lo que todo programador debería saber sobre aritmética de punto flotante
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'master' of github.com:brazzy/floating-point-gui.de

+2 -2
+1 -1
content/basic.html
··· 28 28 29 29 * If you really need your results to add up exactly, especially when you work with money: use a special [decimal datatype](/formats/exact/). 30 30 * If you just don't want to see all those extra decimal places: simply format your result rounded to a fixed number of decimal places when displaying it. 31 - * If you have no decimal datatype available, an alternative is to work with [integers](/formats/integers/), e.g. do money calculations entirely in cents. But this is more work and has some drawbacks. 31 + * If you have no decimal datatype available, an alternative is to work with [integers](/formats/integer/), e.g. do money calculations entirely in cents. But this is more work and has some drawbacks. 32 32 33 33 ### Why do other calculations like 0.1 + 0.4 work correctly? 34 34
+1 -1
content/errors/rounding.html
··· 51 51 | -1.6 | -1 | -2 | -2 | 52 52 | 2.6 | 2 | 3 | 3 | 53 53 | 2.5 | 2 | 3 | 2 | 54 - | -2.4 | -2 | -2 | 2 | 54 + | -2.4 | -2 | -2 | -2 | 55 55 56 56 Note that for [base 2](/formats/binary/), both "rounding half" modes are identical. 57 57 More [rounding methods](http://en.wikipedia.org/wiki/Rounding) can be found at Wikipedia.