1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

force float

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

  1. macrumors 6502a

    hi I was wondering if anyone could tell me what's wrong with this statement.

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


    If you're trying to convert base to a float, your syntax is incorrect. And you're missing a matching parentheses. Try:

    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


    After fixing the bugs, can you explain why you are throwing away most of the available precision?

Share This Page