User Tag List

Results 1 to 7 of 7

Thread: Const Floats with Negative Values

  1. #1
    Octorok
    Join Date
    Mar 2008
    Age
    35
    Posts
    128
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    864
    Level
    10
    vBActivity - Bars
    Lv. Percent
    25.31%

    Sick Bug Const Floats with Negative Values

    Seems like what's happening is that the decimal part is being added, rather than subtracted, by the compiler?
    While -5.0 compiles to -5.0, -4.9 instead compiles to -3.1. (So it's -4 + 0.9 instead of -4 - 0.9.)
    So if what you want really want is a const float of -4.9, you need ask for -5.1 instead.

  2. #2
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,760
    Level
    21
    vBActivity - Bars
    Lv. Percent
    68.72%
    Oh joy. They also truncate where they should not: As I recall, they were being read into the string impropery, because the sign was increasing the length of the value; and Saffith fixed them in the post 2.50.2 codebase, prior to the source release. (See: http://shardstorm.com)

    Needs confirmation, and IDK if these returns were fixed at the same time as that issue. @Saffith

    This was in the old bugs database, that has been archived.
    @Gleeok , I think we need the last x-months of that revived.

    Prior thread: http://armageddongames.net/showthrea...ax-Float-Error

  3. #3
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,817
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,940
    Level
    33
    vBActivity - Bars
    Lv. Percent
    24.2%
    Fixed by changing the 'const' keyword to 'wacky'. From now on you can declare them as:

    Code:
    wacky int value = -4.9; //actually -3.1 according to wacky specification.

    ...Or possibly the negation can apply to the thing at the end n' stuff... that could also work. (I had thought this was fixed already for some reason)
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  4. #4
    Octorok
    Join Date
    Mar 2008
    Age
    35
    Posts
    128
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    864
    Level
    10
    vBActivity - Bars
    Lv. Percent
    25.31%
    I lost a couple of very confused hours to this one. I had a legit logic error that was causing a variable controlling x speed to not retain its full significance, and this was a value I was using for terminal velocity on the y axis and I thought -4.9 being so much less than -5.0 was a related problem, but nope.

    "* Fixed negative constants being read incorrectly."
    Oh so maybe this one was fixed then...? If that turns out to be the case I have a back-up bug I could use for this thread I guess.

  5. #5
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,760
    Level
    21
    vBActivity - Bars
    Lv. Percent
    68.72%
    Quote Originally Posted by CSD View Post
    "* Fixed negative constants being read incorrectly."
    Oh so maybe this one was fixed then...? If that turns out to be the case I have a back-up bug I could use for this thread I guess.

    Back-up bug? Hahahah. We need to keep them in reserve, now, instead of just reporting them?

    What I know was fixed, was improper truncation. Negative constants doing whatevery they please was overlooked for a very long while, it seems.

  6. #6
    Octorok
    Join Date
    Mar 2008
    Age
    35
    Posts
    128
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    864
    Level
    10
    vBActivity - Bars
    Lv. Percent
    25.31%
    Well I don't think it deserves a thread and I don't want to just lump it in with something else, so if this bug is fixed already it's the perfect time!
    Last edited by ZoriaRPG; 07-26-2016 at 03:34 AM.

  7. #7
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,760
    Level
    21
    vBActivity - Bars
    Lv. Percent
    68.72%
    I'm going to state as a fact, that it's easier for us if all bugs are in their own threads, however minor. If someone wants to post 1000 threads with minor bug reports, it'd be easier to go through, do them one at a time, and tick them 'sick', than it is to handle one thread with more then one bug. That make sit much harder to categorise them, when we fix, verify, or otherwise handle them.

    Pretty much, I'd end up manually splitting it into a new thread anyway. [/mod]

    Quote Originally Posted by Gleeok View Post
    Fixed by changing the 'const' keyword to 'wacky'. From now on you can declare them as:

    Code:
    wacky int value = -4.9; //actually -3.1 according to wacky specification.

    ...Or possibly the negation can apply to the thing at the end n' stuff... that could also work. (I had thought this was fixed already for some reason)

    Don't...tempt...me...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social