Results 1 to 3 of 3

Thread: [RESOLVED] what the - single not accurate?

  1. #1

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Resolved [RESOLVED] what the - single not accurate?

    Whats with this??

    the result of:
    CDbl(csng(35.8))

    is:
    35.799999237060547

    Thanks Kris

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: what the - single not accurate?

    That's the nature of floating-point numbers. Not all numbers can be represented in the space allocated to store the value and converting between types is one of the things that will highlight this. If you need absolute accuracy then you need to use the Decimal type, but it's bigger and slower.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Re: what the - single not accurate?

    i thought this may be the case

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width