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

mdeh

macrumors 6502
Original poster
Jan 3, 2009
345
2
Using "Special characters" in Xcode, I can do this:

1 X 10³, but how can one do 1 X 10(negative)³ ?


thanks
 

autorelease

macrumors regular
Oct 13, 2008
144
0
Achewood, CA
I hope you're not trying to use "1 X 10³" as a numeric literal in your code, since that's nowhere near correct.

If you're using that in a string (e.g. as a prompt to the user) it's not a problem. If you want to use scientific notation to specify a value for a float or double, the proper syntax is 1e3. Also, in this way, 1x10^(-3) would be 1e-3. The "e" means "times 10 to the power of."
 

mdeh

macrumors 6502
Original poster
Jan 3, 2009
345
2
I hope you're not trying to use "1 X 10³" as a numeric literal in your code, since that's nowhere near correct.

NO, just trying to make a fancy string literal to use in NSLOG, but I guess that is why they came up with scientific notation.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.