force float

Discussion in 'Mac Programming' started by chris200x9, Feb 17, 2008.

  1. macrumors 6502a

    Joined:
    Jun 3, 2006
    #1
    hi I was wondering if anyone could tell me what's wrong with this statement.

    Code:
     digit = (num/ pow( float base, numDigits - num); 
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    If you're trying to convert base to a float, your syntax is incorrect. And you're missing a matching parentheses. Try:

    Code:
    digit = (num/ pow( [b][color=red]([/color][/b]float[b][color=red])[/color][/b] base, numDigits - num)[b][color=red])[/color][/b];
     
  3. macrumors G5

    gnasher729

    Joined:
    Nov 25, 2005
    #3
    After fixing the bugs, can you explain why you are throwing away most of the available precision?
     

Share This Page