Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chris200x9

macrumors 6502a
Original poster
Jun 3, 2006
906
0
hi I was wondering if anyone could tell me what's wrong with this statement.

Code:
 digit = (num/ pow( float base, numDigits - num);
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
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];
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,566
hi I was wondering if anyone could tell me what's wrong with this statement.

Code:
 digit = (num/ pow( float base, numDigits - num);

After fixing the bugs, can you explain why you are throwing away most of the available precision?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.