Floating point numbers aren't perfectly precise. See http://c-faq.com/fp/
--david On 1/22/06, ramrunner <[EMAIL PROTECTED]> wrote: > Hi , i am not sure if the following indicates a prob, if it does i > will issue a PR. > *sorry if i miss something here* > cosider the following: (obsd x86 3.8-current gcc version 3.3.5 (propolice)) > float a; > int main() > { > for(;a<3;a+=0.1) > printf("%f\n",a); > return 1; > } > output : > 0.000000 > 0.100000 > .... > 2.700000 > 2.799999 > 2.899999 > 2.999999 > why does the add loses a decimal point? > again sorry if it's my mistake (probably) but i'm confused ;) . > > please CC not in [EMAIL PROTECTED] > DsP