Ignore:
Timestamp:
Dec 23, 2002, 12:01:35 AM (20 years ago)
Author:
Sam Hocevar
Message:
  • fixed a segfault when the target seeker speed was zero.
  • factorized the seeker generation on fragbomb explosion.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/math.c

    r43 r45  
    44 *                 All Rights Reserved
    55 *
    6  *   $Id: math.c,v 1.1 2002/12/22 22:36:42 sam Exp $
     6 *   $Id: math.c,v 1.2 2002/12/22 23:01:35 sam Exp $
    77 *
    88 *   This program is free software; you can redistribute it and/or modify
     
    2727    int x = a > 100000 ? 1000 : a > 1000 ? 100 : a > 10 ? 10 : 1;
    2828
    29     /* Newton's method. Three iterations are more than enough. */
     29    if( a <= 0 )
     30    {
     31        return 0;
     32    }
     33
     34    /* Newton's method. Three iterations would be more than enough. */
    3035    x = (x * x + a) / x / 2;
    3136    x = (x * x + a) / x / 2;
Note: See TracChangeset for help on using the changeset viewer.