Paul SoltiPhoneDev.tvNumbersThe data behind our apps
Paul SoltiPhoneDev.tvOverview•Integers (27)•printf()•Floating-point numbers (3.14)•Math libraries
Paul SoltiPhoneDev.tvIntegers•char: ‘a’,‘b’,‘c’•short: 32,000•int: 2,000,000,000•long: 9,000,000,000,000,000,000•long long...
Paul SoltiPhoneDev.tvIntegers•char: ‘a’,‘b’,‘c’ (8 bits = 1 byte)•short: 32,000 (16 bits)•int: 2,000,000,000 (32 bits)•lon...
Paul SoltiPhoneDev.tvOverflow99999999991000000010000000
Paul SoltiPhoneDev.tvprintf•Formatted text•Tokens•n (i.e. newline or return)%d int%c char%f float/double%s char * (i.e. tex...
Paul SoltiPhoneDev.tvMath8 + 4 * 2 = ?(8 + 4) * 2 = ?
Paul SoltiPhoneDev.tvInteger Division5 / 2 = ?5 % 2 = ?
Paul SoltiPhoneDev.tvInteger Division5 / 2 = 25 % 2 = 1
Paul SoltiPhoneDev.tvFloating-point Numbers•float: 3.14•double: 3.141592653
Paul SoltiPhoneDev.tvFloating-point Numbers•float: 3.14 (32 bits)•double: 3.141592653 (64 bits)
Paul SoltiPhoneDev.tvMath Library#include <stdlib.h>abs(-13); // absolute value#include <math.h>cos(60 * M_PI / 180.0); //...
Paul SoltiPhoneDev.tvReview•Integers•printf()•Floating-point numbers•Math libraries
Paul SoltiPhoneDev.tv
Upcoming SlideShare
Loading in …5
×

Numbers and Values in Objective-C and C Programming

621 views
512 views

Published on

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
621
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
5
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Numbers and Values in Objective-C and C Programming

  1. 1. Paul SoltiPhoneDev.tvNumbersThe data behind our apps
  2. 2. Paul SoltiPhoneDev.tvOverview•Integers (27)•printf()•Floating-point numbers (3.14)•Math libraries
  3. 3. Paul SoltiPhoneDev.tvIntegers•char: ‘a’,‘b’,‘c’•short: 32,000•int: 2,000,000,000•long: 9,000,000,000,000,000,000•long long: 9,000,000,000,000,000,000
  4. 4. Paul SoltiPhoneDev.tvIntegers•char: ‘a’,‘b’,‘c’ (8 bits = 1 byte)•short: 32,000 (16 bits)•int: 2,000,000,000 (32 bits)•long: 9,000,000,000,000,000,000 (32 or 64 bits)•long long: 9,000,000,000,000,000,000 (64 bits)
  5. 5. Paul SoltiPhoneDev.tvOverflow99999999991000000010000000
  6. 6. Paul SoltiPhoneDev.tvprintf•Formatted text•Tokens•n (i.e. newline or return)%d int%c char%f float/double%s char * (i.e. text)%ld long
  7. 7. Paul SoltiPhoneDev.tvMath8 + 4 * 2 = ?(8 + 4) * 2 = ?
  8. 8. Paul SoltiPhoneDev.tvInteger Division5 / 2 = ?5 % 2 = ?
  9. 9. Paul SoltiPhoneDev.tvInteger Division5 / 2 = 25 % 2 = 1
  10. 10. Paul SoltiPhoneDev.tvFloating-point Numbers•float: 3.14•double: 3.141592653
  11. 11. Paul SoltiPhoneDev.tvFloating-point Numbers•float: 3.14 (32 bits)•double: 3.141592653 (64 bits)
  12. 12. Paul SoltiPhoneDev.tvMath Library#include <stdlib.h>abs(-13); // absolute value#include <math.h>cos(60 * M_PI / 180.0); // radians
  13. 13. Paul SoltiPhoneDev.tvReview•Integers•printf()•Floating-point numbers•Math libraries
  14. 14. Paul SoltiPhoneDev.tv

×