Results 1 to 10 of 10

Thread: Dim Fuel as Double???

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184
    Im making a lander game..

    And Theres a Line..

    Private Fuel as Double

    Why isnt it a integer??

    Whats a double??

    thanks!
    Evan Duffield --------
    --- [email protected]
    - -
    VB6 - Learning Edition
    - -


  2. #2
    Addicted Member Razzle's Avatar
    Join Date
    Jan 2000
    Location
    Berlin, Germany
    Posts
    161
    double is for numbers with floating decimal point. it's even more precise than single

    the max value range of integer is -32768 to 32767 while the single's is -3.402823E38 to -1.401298E-45 and the double's is -1.79769313486232E308 to 4.94065645841247E-657 (negative) and 4.94065645841247E-324 to 1.79769313426232E308 (positive). (single can't be zero but a value very near to zero)

    [Edited by Razzle on 05-06-2000 at 06:45 PM]
    Razzle
    ICQ#: 31429438
    What is the difference between a raven?
    -The legs. The length is equal, especially the right one.

  3. #3
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    just in case you want that in english a double is a variable that can store decimals, integers and longs can only store whole numbers.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184
    Geezs..lol
    Thanks Both of you
    Evan Duffield --------
    --- [email protected]
    - -
    VB6 - Learning Edition
    - -


  5. #5
    Guest

    ????????

    your making a game and it was already set as double?
    I think you ripped some code off some people
    or you wouldnt have even used double if you didnt know what it is....

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184
    hehe,

    good thinking..
    I was making the game that is on the
    front page of this website.. Called
    Lander 3.0. Its really neat.. He used
    a ddouble so I asked
    Evan Duffield --------
    --- [email protected]
    - -
    VB6 - Learning Edition
    - -


  7. #7
    Guest

    razzle...

    why can't a Single variable evaluate to 0?
    it doesnt seem to protest when I set it to 0!

  8. #8
    Addicted Member Razzle's Avatar
    Join Date
    Jan 2000
    Location
    Berlin, Germany
    Posts
    161
    you can set it to zero and if you read it out it's still zero. but the actual value isn't 0 but 0.0000000000...(somewhere at the end there's a number different from zero).
    The difference is SO small, you can't see it so easily
    Razzle
    ICQ#: 31429438
    What is the difference between a raven?
    -The legs. The length is equal, especially the right one.

  9. #9
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    How are they stored if you can't set them to zero, I thought they had an exponent and a mantissa, 00000 for the mantissa would give zero wouldn't it.

  10. #10
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I think i had the same problem with double once, multiplying E-12 by 10 up to E0 was differing so little that vb showed 1 but showed x>=1 to be false. So I don't use double for delicate things
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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