Floating point

Created By: nlko
Last Modified: 12/04/07
Popular Tags
- 127 Jetpaks are tagged with
- 79 Jetpaks are tagged with ajax
- 83 Jetpaks are tagged with anime
- 64 Jetpaks are tagged with apple
- 245 Jetpaks are tagged with art
- 198 Jetpaks are tagged with blog
- 166 Jetpaks are tagged with blogs
- 102 Jetpaks are tagged with books
- 95 Jetpaks are tagged with bpolitics
- 142 Jetpaks are tagged with bush
- 153 Jetpaks are tagged with business
- 168 Jetpaks are tagged with computer
- 230 Jetpaks are tagged with cool
- 129 Jetpaks are tagged with css
- 257 Jetpaks are tagged with design
- 87 Jetpaks are tagged with development
- 64 Jetpaks are tagged with digital
- 92 Jetpaks are tagged with download
- 150 Jetpaks are tagged with education
- 89 Jetpaks are tagged with email
- 111 Jetpaks are tagged with entertainment
- 73 Jetpaks are tagged with environment
- 186 Jetpaks are tagged with firefox
- 86 Jetpaks are tagged with flash
- 128 Jetpaks are tagged with food
- 67 Jetpaks are tagged with forum
- 102 Jetpaks are tagged with free
- 122 Jetpaks are tagged with fun
- 137 Jetpaks are tagged with funny
- 88 Jetpaks are tagged with game
- 284 Jetpaks are tagged with games
- 121 Jetpaks are tagged with google
- 81 Jetpaks are tagged with graphics
- 123 Jetpaks are tagged with health
- 96 Jetpaks are tagged with history
- 99 Jetpaks are tagged with html
- 77 Jetpaks are tagged with humor
- 65 Jetpaks are tagged with ideas
- 175 Jetpaks are tagged with images
- 150 Jetpaks are tagged with info
- 133 Jetpaks are tagged with information
- 74 Jetpaks are tagged with inspiration
- 214 Jetpaks are tagged with internet
- 82 Jetpaks are tagged with iraq
- 186 Jetpaks are tagged with java
- 92 Jetpaks are tagged with javascript
- 182 Jetpaks are tagged with jeteye
- 66 Jetpaks are tagged with jobs
- 80 Jetpaks are tagged with learning
- 120 Jetpaks are tagged with links
- 215 Jetpaks are tagged with linux
- 89 Jetpaks are tagged with marketing
- 101 Jetpaks are tagged with media
- 68 Jetpaks are tagged with money
- 77 Jetpaks are tagged with movie
- 173 Jetpaks are tagged with movies
- 70 Jetpaks are tagged with mp3
- 558 Jetpaks are tagged with music
- 71 Jetpaks are tagged with myspace
- 345 Jetpaks are tagged with news
- 122 Jetpaks are tagged with online
- 66 Jetpaks are tagged with opensource
- 108 Jetpaks are tagged with photo
- 153 Jetpaks are tagged with photography
- 129 Jetpaks are tagged with photos
- 122 Jetpaks are tagged with photoshop
- 101 Jetpaks are tagged with php
- 89 Jetpaks are tagged with pics
- 136 Jetpaks are tagged with pictures
- 328 Jetpaks are tagged with politics
- 148 Jetpaks are tagged with programming
- 72 Jetpaks are tagged with radio
- 82 Jetpaks are tagged with recipes
- 92 Jetpaks are tagged with reference
- 113 Jetpaks are tagged with research
- 78 Jetpaks are tagged with resources
- 102 Jetpaks are tagged with school
- 143 Jetpaks are tagged with science
- 85 Jetpaks are tagged with search
- 155 Jetpaks are tagged with shopping
- 261 Jetpaks are tagged with software
- 65 Jetpaks are tagged with stuff
- 170 Jetpaks are tagged with technology
- 354 Jetpaks are tagged with test
- 75 Jetpaks are tagged with tips
- 107 Jetpaks are tagged with tools
- 176 Jetpaks are tagged with travel
- 67 Jetpaks are tagged with tutorial
- 144 Jetpaks are tagged with tutorials
- 141 Jetpaks are tagged with tv
- 291 Jetpaks are tagged with video
- 155 Jetpaks are tagged with videos
- 74 Jetpaks are tagged with war
- 540 Jetpaks are tagged with web
- 80 Jetpaks are tagged with web2.0
- 91 Jetpaks are tagged with webdesign
- 69 Jetpaks are tagged with website
- 67 Jetpaks are tagged with websites
- 112 Jetpaks are tagged with work
- 85 Jetpaks are tagged with youtube




En simplifiant :
- 32 bits, c'est une precision à 10 exp -6 près, genre pi=3.14159xxxxxxxxxxx (x n'étant pas la valeur exacte de pi)
- 64 bits, c'est une precision à 10 exp -15 près, genre pi=3.14159265358979xxxxx (x n'étant pas la valeur exacte de pi)
- 80 bits, c'est une precision à 10 exp -20 près, genre pi=3.14159265358979323846xx (x n'étant pas la valeur exacte de pi)
Donc ca dépend si le nombre que tu veux à la fin soit précis ou pas.
Rajoute que pour chaque opération, tu perds la moité de précision (pour schématiser) au moins, il faut que tu prévois de la marge dans ta précision.
Par exemple, si en shématisant (je schématise hein, pour les puristes je sais que c'est plus complexe, et mon exemple n'est pas la réalité) :
(float)0.000005 + (float)0.000005 --> 0.00001 + 0.00001 (ben oui, le float a du mal à stocker la précision) --> 0.00002
alors qu'avec un double :
0.000005 + 0.000005 --> 0.00001
Dans cet exemple, il faut que tu sois conscient que le chiffre fourni est juste a + ou - 0.00001. Généralement on affiche pas autant de chiffres après la virgule, pour justement éviter ce + ou -.
Bref, en gros si tu calcules des valeurs avec juste très peu de chiffres importants pour toi --> 32 bits, sinon 64 bits.
(dans le même style, j'adore les sondages précis à 0.1% près, alors que le dégré de précision des sondages est de + ou -2 à 3 % en général, chiffre indiqué par IPSOS dans son papier mais oublié par les journalistes qui veulent simplifier : un sondage a 51.3% + ou - 3% pour une personne veut juste dire que le sondage estime entre 48.3% et 54.3% le score du candidat, donc que le chiffre peut être inférieur à 50%, chose oubliée...)