SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
Paul Solt
iPhoneDev.tv
Numbers
The data behind our apps
Paul Solt
iPhoneDev.tv
Overview
•Integers (27)
•printf()
•Floating-point numbers (3.14)
•Math libraries
Paul Solt
iPhoneDev.tv
Integers
•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
Paul Solt
iPhoneDev.tv
Integers
•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)
Paul Solt
iPhoneDev.tv
Overflow
99999
99999
10000000
10000000
Paul Solt
iPhoneDev.tv
printf
•Formatted text
•Tokens
•n (i.e. newline or return)
%d int
%c char
%f float/double
%s char * (i.e. text)
%ld long
Paul Solt
iPhoneDev.tv
Math
8 + 4 * 2 = ?
(8 + 4) * 2 = ?
Paul Solt
iPhoneDev.tv
Integer Division
5 / 2 = ?
5 % 2 = ?
Paul Solt
iPhoneDev.tv
Integer Division
5 / 2 = 2
5 % 2 = 1
Paul Solt
iPhoneDev.tv
Floating-point Numbers
•float: 3.14
•double: 3.141592653
Paul Solt
iPhoneDev.tv
Floating-point Numbers
•float: 3.14 (32 bits)
•double: 3.141592653 (64 bits)
Paul Solt
iPhoneDev.tv
Math Library
#include <stdlib.h>
abs(-13); // absolute value
#include <math.h>
cos(60 * M_PI / 180.0); // radians
Paul Solt
iPhoneDev.tv
Review
•Integers
•printf()
•Floating-point numbers
•Math libraries
Paul Solt
iPhoneDev.tv

Mais conteúdo relacionado

Mais procurados (6)

Hello world program
Hello world programHello world program
Hello world program
 
Ford Fulkerson Algorithm
Ford Fulkerson AlgorithmFord Fulkerson Algorithm
Ford Fulkerson Algorithm
 
Placevalue
PlacevaluePlacevalue
Placevalue
 
RM FUNCIONAL
RM FUNCIONALRM FUNCIONAL
RM FUNCIONAL
 
Circumference and area of cirlce
Circumference and area of cirlceCircumference and area of cirlce
Circumference and area of cirlce
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 

Destaque

Cpu cycle
Cpu cycleCpu cycle
Cpu cycle
maciakl
 
Authoring tools worksheet
Authoring tools worksheetAuthoring tools worksheet
Authoring tools worksheet
Farid Diah
 
Low Level Exploits
Low Level ExploitsLow Level Exploits
Low Level Exploits
hughpearse
 
Flags
FlagsFlags
Flags
CME
 

Destaque (20)

Functions in Objective-C and C Programming
Functions in Objective-C and C ProgrammingFunctions in Objective-C and C Programming
Functions in Objective-C and C Programming
 
Api a scuola
Api a scuolaApi a scuola
Api a scuola
 
Wk1to4
Wk1to4Wk1to4
Wk1to4
 
Cpu cycle
Cpu cycleCpu cycle
Cpu cycle
 
Authoring tools worksheet
Authoring tools worksheetAuthoring tools worksheet
Authoring tools worksheet
 
02 - Introduction to the cdecl ABI and the x86 stack
02 - Introduction to the cdecl ABI and the x86 stack02 - Introduction to the cdecl ABI and the x86 stack
02 - Introduction to the cdecl ABI and the x86 stack
 
Python Yield
Python YieldPython Yield
Python Yield
 
2장. Runtime Data Areas
2장. Runtime Data Areas2장. Runtime Data Areas
2장. Runtime Data Areas
 
Stack Frame Protection
Stack Frame ProtectionStack Frame Protection
Stack Frame Protection
 
Smashing The Stack
Smashing The StackSmashing The Stack
Smashing The Stack
 
Introduction to Linux Exploit Development
Introduction to Linux Exploit DevelopmentIntroduction to Linux Exploit Development
Introduction to Linux Exploit Development
 
Exploit techniques and mitigation
Exploit techniques and mitigationExploit techniques and mitigation
Exploit techniques and mitigation
 
Introduction to pointers and memory management in C
Introduction to pointers and memory management in CIntroduction to pointers and memory management in C
Introduction to pointers and memory management in C
 
Addressing
Addressing Addressing
Addressing
 
Reversing & Malware Analysis Training Part 4 - Assembly Programming Basics
Reversing & Malware Analysis Training Part 4 - Assembly Programming BasicsReversing & Malware Analysis Training Part 4 - Assembly Programming Basics
Reversing & Malware Analysis Training Part 4 - Assembly Programming Basics
 
Low Level Exploits
Low Level ExploitsLow Level Exploits
Low Level Exploits
 
Debugging Applications with GNU Debugger
Debugging Applications with GNU DebuggerDebugging Applications with GNU Debugger
Debugging Applications with GNU Debugger
 
Virtual Machine Constructions for Dummies
Virtual Machine Constructions for DummiesVirtual Machine Constructions for Dummies
Virtual Machine Constructions for Dummies
 
Advanced exploit development
Advanced exploit developmentAdvanced exploit development
Advanced exploit development
 
Flags
FlagsFlags
Flags
 

Semelhante a Numbers and Values in Objective-C and C Programming

Python workshop intro_string (1)
Python workshop intro_string (1)Python workshop intro_string (1)
Python workshop intro_string (1)
Karamjit Kaur
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
TAlha MAlik
 

Semelhante a Numbers and Values in Objective-C and C Programming (20)

Basic arithmetic, instruction execution and program
Basic arithmetic, instruction execution and programBasic arithmetic, instruction execution and program
Basic arithmetic, instruction execution and program
 
Python
PythonPython
Python
 
C# What's next? (7.x and 8.0)
C# What's next? (7.x and 8.0)C# What's next? (7.x and 8.0)
C# What's next? (7.x and 8.0)
 
Modern C++
Modern C++Modern C++
Modern C++
 
primitive data types
 primitive data types primitive data types
primitive data types
 
CNS__M4_MD5 Crypto graphyCNS__M4_MD5 Crypto graphyCNS__M4_MD5 Crypto graphy
CNS__M4_MD5 Crypto graphyCNS__M4_MD5 Crypto graphyCNS__M4_MD5 Crypto graphyCNS__M4_MD5 Crypto graphyCNS__M4_MD5 Crypto graphyCNS__M4_MD5 Crypto graphy
CNS__M4_MD5 Crypto graphyCNS__M4_MD5 Crypto graphyCNS__M4_MD5 Crypto graphy
 
CSC103 Bits, Bytes & Binary
CSC103 Bits, Bytes & BinaryCSC103 Bits, Bytes & Binary
CSC103 Bits, Bytes & Binary
 
Cryptographic Algorithms: DES and RSA
Cryptographic Algorithms: DES and RSACryptographic Algorithms: DES and RSA
Cryptographic Algorithms: DES and RSA
 
Acm aleppo cpc training second session
Acm aleppo cpc training second sessionAcm aleppo cpc training second session
Acm aleppo cpc training second session
 
Computer Programming Module 14 review--Math Functions and Strings
Computer Programming Module 14 review--Math Functions and StringsComputer Programming Module 14 review--Math Functions and Strings
Computer Programming Module 14 review--Math Functions and Strings
 
Cryptography Symmetric Key Algorithm (CSE)
Cryptography Symmetric Key Algorithm (CSE)Cryptography Symmetric Key Algorithm (CSE)
Cryptography Symmetric Key Algorithm (CSE)
 
C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8
 
Python workshop intro_string (1)
Python workshop intro_string (1)Python workshop intro_string (1)
Python workshop intro_string (1)
 
0-Slot14-15-16-Libraries.pdf
0-Slot14-15-16-Libraries.pdf0-Slot14-15-16-Libraries.pdf
0-Slot14-15-16-Libraries.pdf
 
0-Slot21-22-Strings.pdf
0-Slot21-22-Strings.pdf0-Slot21-22-Strings.pdf
0-Slot21-22-Strings.pdf
 
C# - What's next
C# - What's nextC# - What's next
C# - What's next
 
Graph500 and Green Graph500 benchmarks on SGI UV2000 @ SGI UG SC14
Graph500 and Green Graph500 benchmarks on SGI UV2000 @ SGI UG SC14Graph500 and Green Graph500 benchmarks on SGI UV2000 @ SGI UG SC14
Graph500 and Green Graph500 benchmarks on SGI UV2000 @ SGI UG SC14
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Programming using c++ tool
Programming using c++ toolProgramming using c++ tool
Programming using c++ tool
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Numbers and Values in Objective-C and C Programming