SlideShare a Scribd company logo
1   2   3   4
진수 표기법
0x[   ] , 0X[   ] : 16진수 표기법           음의 무한대 (-Infinity)
0d[   ], 0D[    ], [    ] : 10진수 표기법   -1.0/0.0 의 결과 등. 어떤 값보다도 작다.
0o[   ], 0O[    ], 0[   ] : 8진수 표기법
0b[   ], 0B[    ] : 2진수 표기법            비수 (NaN)
                                       0.0/0.0 의 결과. 어떤 수 와도 같지 않다.
Float 상수들                              자기 자신과도 같지 않다.
DIG : Float이 표현 가능한 최대 10진 자릿수         Nan = 0.0/0.0
MAX : Float이 갖는 최대값                    Nan == Nan => false
MIN : Float 이 갖는 최소값                   Nan.nan? => true


양의 무한대 (Infinity)
1.0/0.0 의 결과 등. 어떤 값보다도 크다.
Inf = 1.0/0.0
Inf > 0.0 => true
Inf.infinite? => true
Inf.finite? => false
연산자                                   그 외 수치연산 메소드
+ : 덧셈 연산자                            .divmode(x) => [x로 나눈 몫, 나머지]
- : 뺄셈 연산자                            .abs => 절대값
* : 곱셈 연산자                            .ceil => 소수점 올림
** : 제곱 연산자
% : 나머지 연산자                           명시적 형 변환
                                      .to_i => 정수형으로 변환
                                      .to_f => 실수형으로 변환
규칙                                    1+”2”.to_i => 3
1. 제수,피제수가 모두 정수이면 정수연산               7.to_f/2 => 3.5
둘중 하나라도 실수 이면 실수연산 한다.
2. 정수연산에서 0으로 나누면 에러 발생.              자동 형 변환
3. 실수연산에서 0으로 나누면 피제수에                정수와 실수 연산시 자동으로 실수화
따라 Infinity, -Infinity, NaN 을 반환한다.   7+3.0 => 10.0
4. 나머지연산의 해는 제수와 부호가 같다.
5. 우선순위는 산술과 같다.
비교 연산자
== : 같다
!= : 같지 않다
x < y : x 가 y 보다 작다
x > y : x 가 y 보다 크다
x <= y : x 가 y 보다 작거나 같다
x >= y : x 가 y 보다 크거나 같다


우주선 연산자
x <=> y : x가 y보다 작으면 -1
          x가 y와 같으면 0
          x가 y보다 크면 1
주로 크기별로 소팅 할 때 쓰인다.
Math Module


Math.acos(x) : 역 코사인함수
Math.log(x) : 자연대수


함수 참조에는 . 대신 :: 를 사용할 수 있다.
Math::sqrt(x) : 제곱근


모듈을 현재 범위에 include 하면 범위 지정자를 사용하지 않아도 된다.
Include Math
cos(x), log(x), acos(x), sin(x), sqrt(x) 등
Ruby - 3rd (수치의 핵심)

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Ruby - 3rd (수치의 핵심)

  • 1.
  • 2. 1 2 3 4
  • 3.
  • 4. 진수 표기법 0x[ ] , 0X[ ] : 16진수 표기법 음의 무한대 (-Infinity) 0d[ ], 0D[ ], [ ] : 10진수 표기법 -1.0/0.0 의 결과 등. 어떤 값보다도 작다. 0o[ ], 0O[ ], 0[ ] : 8진수 표기법 0b[ ], 0B[ ] : 2진수 표기법 비수 (NaN) 0.0/0.0 의 결과. 어떤 수 와도 같지 않다. Float 상수들 자기 자신과도 같지 않다. DIG : Float이 표현 가능한 최대 10진 자릿수 Nan = 0.0/0.0 MAX : Float이 갖는 최대값 Nan == Nan => false MIN : Float 이 갖는 최소값 Nan.nan? => true 양의 무한대 (Infinity) 1.0/0.0 의 결과 등. 어떤 값보다도 크다. Inf = 1.0/0.0 Inf > 0.0 => true Inf.infinite? => true Inf.finite? => false
  • 5.
  • 6. 연산자 그 외 수치연산 메소드 + : 덧셈 연산자 .divmode(x) => [x로 나눈 몫, 나머지] - : 뺄셈 연산자 .abs => 절대값 * : 곱셈 연산자 .ceil => 소수점 올림 ** : 제곱 연산자 % : 나머지 연산자 명시적 형 변환 .to_i => 정수형으로 변환 .to_f => 실수형으로 변환 규칙 1+”2”.to_i => 3 1. 제수,피제수가 모두 정수이면 정수연산 7.to_f/2 => 3.5 둘중 하나라도 실수 이면 실수연산 한다. 2. 정수연산에서 0으로 나누면 에러 발생. 자동 형 변환 3. 실수연산에서 0으로 나누면 피제수에 정수와 실수 연산시 자동으로 실수화 따라 Infinity, -Infinity, NaN 을 반환한다. 7+3.0 => 10.0 4. 나머지연산의 해는 제수와 부호가 같다. 5. 우선순위는 산술과 같다.
  • 7.
  • 8. 비교 연산자 == : 같다 != : 같지 않다 x < y : x 가 y 보다 작다 x > y : x 가 y 보다 크다 x <= y : x 가 y 보다 작거나 같다 x >= y : x 가 y 보다 크거나 같다 우주선 연산자 x <=> y : x가 y보다 작으면 -1 x가 y와 같으면 0 x가 y보다 크면 1 주로 크기별로 소팅 할 때 쓰인다.
  • 9.
  • 10. Math Module Math.acos(x) : 역 코사인함수 Math.log(x) : 자연대수 함수 참조에는 . 대신 :: 를 사용할 수 있다. Math::sqrt(x) : 제곱근 모듈을 현재 범위에 include 하면 범위 지정자를 사용하지 않아도 된다. Include Math cos(x), log(x), acos(x), sin(x), sqrt(x) 등