CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: 1.#inf

  1. #1
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    340

    1.#inf

    Hi,

    I am getting a weird error. While printing the contents of a float array, some of the entries are printed as 1.#INF

    Is this divide by zero or infinity error??

    Also, this only happens when I declare the array as float, it is all right when I declare the array as double.

    Any ideas?

    Xargon

  2. #2
    Join Date
    Oct 2002
    Location
    Arkansas, USA
    Posts
    189
    this only happens when I declare the array as float, it is all right when I declare the array as double
    Sounds like you have exceeded the limits of a float for some of the stored elements in your array.

    A float can hold values in the range of 3.4E +/- 38 (7 digits), and a double in the range of 1.7E +/- 308 (15 digits).

    If you need to keep the values as they currently are, you would be better off to continue to use the array of doubles to hold them.

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

Featured