<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[QP School - Ruby 3 Tutorials, exercises and examples]]></title>
		<link>https://qomplainerzschool.lima-city.de/</link>
		<description><![CDATA[QP School - https://qomplainerzschool.lima-city.de]]></description>
		<pubDate>Mon, 13 Apr 2026 02:38:12 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Everything you need to know about Ruby]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=5056</link>
			<pubDate>Tue, 25 Jul 2023 11:53:14 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=5056</guid>
			<description><![CDATA[Ruby is a dynamic, object-oriented programming language known for its simplicity, elegance, and productivity. It was created in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan. Ruby's design philosophy focuses on the principle of "optimization for developer happiness," aiming to make programming a joyful and efficient experience for developers. Here's everything you need to know about Ruby:<br />
<br />
Object-Oriented: Ruby is a fully object-oriented language, meaning everything in Ruby is an object, including numbers, strings, and even classes. It follows the principles of object-oriented programming (OOP), such as encapsulation, inheritance, and polymorphism.<br />
<br />
Dynamic Typing: Ruby is dynamically-typed, which means you don't need to explicitly declare the data type of a variable. The type of a variable is determined at runtime.<br />
<br />
Interpreted Language: Ruby is an interpreted language, which means that code is executed directly without the need for a separate compilation step.<br />
<br />
Readable and Expressive Syntax: Ruby's syntax is designed to be readable and expressive, making it easy to write and understand code. It is often praised for its clean and natural language-like constructs.<br />
<br />
Gems and RubyGems: Ruby has a rich ecosystem of third-party libraries and tools, known as "gems." RubyGems is the package manager for Ruby that allows developers to easily install, manage, and share these gems.<br />
<br />
Rails Framework: Ruby on Rails, often referred to as just Rails, is a popular web application framework built on top of Ruby. Rails follows the Model-View-Controller (MVC) architecture and provides conventions to streamline web development.<br />
<br />
Blocks and Procs: Ruby supports blocks and procs, which are anonymous functions that can be passed as arguments to methods. They enable powerful functional programming constructs in the language.<br />
<br />
Metaprogramming: Ruby is known for its strong support of metaprogramming, allowing developers to modify and extend the behavior of classes and objects during runtime.<br />
<br />
Community and Culture: Ruby has a vibrant and welcoming community. The Ruby community values open-source contributions, collaboration, and sharing knowledge.<br />
<br />
Cross-Platform: Ruby is a cross-platform language, which means it runs on various operating systems, including Windows, macOS, and Linux.<br />
<br />
Standard Library: Ruby comes with a robust standard library that provides a wide range of built-in classes and modules for common tasks like file I/O, networking, and data processing.<br />
<br />
Maturity and Stability: Ruby has been around for several decades and has a stable and mature codebase, which makes it reliable for building production-grade applications.<br />
<br />
Ruby is used in a wide range of applications, from web development to scripting and automation. It is known for its "developer-friendly" approach, allowing developers to focus on their code logic rather than boilerplate syntax. The combination of Ruby's readability, flexibility, and community support has made it a favorite language for many developers worldwide.]]></description>
			<content:encoded><![CDATA[Ruby is a dynamic, object-oriented programming language known for its simplicity, elegance, and productivity. It was created in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan. Ruby's design philosophy focuses on the principle of "optimization for developer happiness," aiming to make programming a joyful and efficient experience for developers. Here's everything you need to know about Ruby:<br />
<br />
Object-Oriented: Ruby is a fully object-oriented language, meaning everything in Ruby is an object, including numbers, strings, and even classes. It follows the principles of object-oriented programming (OOP), such as encapsulation, inheritance, and polymorphism.<br />
<br />
Dynamic Typing: Ruby is dynamically-typed, which means you don't need to explicitly declare the data type of a variable. The type of a variable is determined at runtime.<br />
<br />
Interpreted Language: Ruby is an interpreted language, which means that code is executed directly without the need for a separate compilation step.<br />
<br />
Readable and Expressive Syntax: Ruby's syntax is designed to be readable and expressive, making it easy to write and understand code. It is often praised for its clean and natural language-like constructs.<br />
<br />
Gems and RubyGems: Ruby has a rich ecosystem of third-party libraries and tools, known as "gems." RubyGems is the package manager for Ruby that allows developers to easily install, manage, and share these gems.<br />
<br />
Rails Framework: Ruby on Rails, often referred to as just Rails, is a popular web application framework built on top of Ruby. Rails follows the Model-View-Controller (MVC) architecture and provides conventions to streamline web development.<br />
<br />
Blocks and Procs: Ruby supports blocks and procs, which are anonymous functions that can be passed as arguments to methods. They enable powerful functional programming constructs in the language.<br />
<br />
Metaprogramming: Ruby is known for its strong support of metaprogramming, allowing developers to modify and extend the behavior of classes and objects during runtime.<br />
<br />
Community and Culture: Ruby has a vibrant and welcoming community. The Ruby community values open-source contributions, collaboration, and sharing knowledge.<br />
<br />
Cross-Platform: Ruby is a cross-platform language, which means it runs on various operating systems, including Windows, macOS, and Linux.<br />
<br />
Standard Library: Ruby comes with a robust standard library that provides a wide range of built-in classes and modules for common tasks like file I/O, networking, and data processing.<br />
<br />
Maturity and Stability: Ruby has been around for several decades and has a stable and mature codebase, which makes it reliable for building production-grade applications.<br />
<br />
Ruby is used in a wide range of applications, from web development to scripting and automation. It is known for its "developer-friendly" approach, allowing developers to focus on their code logic rather than boilerplate syntax. The combination of Ruby's readability, flexibility, and community support has made it a favorite language for many developers worldwide.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Additions in Ruby]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=3313</link>
			<pubDate>Sun, 14 Mar 2021 11:13:51 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=3313</guid>
			<description><![CDATA[<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">The easiest way to do additions in Ruby is done by passing the values as follows:</span></span></span><br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote: Wrote:</cite>puts 3 + 2</blockquote><br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">The output on the screen will be 5.</span></span></span><br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Another way is storing the values in variables and then adding one variable to the other as follows:</span></span></span><br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote: Wrote:</cite>num1 = 3<br />
num2 = 2<br />
res1 = num1 + num2<br />
puts res1</blockquote><br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">The output on the screen will be 5, too.</span></span></span><br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">In case we don't already know the values that should be added</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">we can ask the user to give us the numbers,</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">store the user inputs in variables</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">and then add one variable to another as follows:</span></span></span><br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote: Wrote:</cite>puts "Please enter a number here: "<br />
num1 = gets.chomp.to_i<br />
puts "Please enter another number here: "<br />
num2 = gets.chomp.to_i<br />
res1 = num1 + num2<br />
puts res1</blockquote><br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Now the output will depend on the user input.</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Assumed the user typed 3 first and 2 later the result will be 5 as well.</span></span></span>]]></description>
			<content:encoded><![CDATA[<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">The easiest way to do additions in Ruby is done by passing the values as follows:</span></span></span><br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote: Wrote:</cite>puts 3 + 2</blockquote><br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">The output on the screen will be 5.</span></span></span><br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Another way is storing the values in variables and then adding one variable to the other as follows:</span></span></span><br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote: Wrote:</cite>num1 = 3<br />
num2 = 2<br />
res1 = num1 + num2<br />
puts res1</blockquote><br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">The output on the screen will be 5, too.</span></span></span><br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">In case we don't already know the values that should be added</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">we can ask the user to give us the numbers,</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">store the user inputs in variables</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">and then add one variable to another as follows:</span></span></span><br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote: Wrote:</cite>puts "Please enter a number here: "<br />
num1 = gets.chomp.to_i<br />
puts "Please enter another number here: "<br />
num2 = gets.chomp.to_i<br />
res1 = num1 + num2<br />
puts res1</blockquote><br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Now the output will depend on the user input.</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Assumed the user typed 3 first and 2 later the result will be 5 as well.</span></span></span>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Subtractions in Ruby]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=3308</link>
			<pubDate>Mon, 08 Mar 2021 12:42:02 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=3308</guid>
			<description><![CDATA[The easiest way to do subtractions in Ruby is done by passing the values as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 3 - 2</blockquote>
<br />
<br />
The output on the screen will be 1.<br />
<br />
Another way is storing the values in variables and then subtracting one variable from the other as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>num1 = 3<br />
num2 = 2<br />
res1 = num1 - num2<br />
puts res1</blockquote>
<br />
<br />
The output on the screen will be 1, too.<br />
<br />
In case we don't already know the values that should be subtracted<br />
we can ask the user to give us the numbers,<br />
store the user inputs in variables<br />
and then subtract one variable from another as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts "Please enter a number here: "<br />
num1 = gets.chomp.to_i<br />
puts "Please enter another number here: "<br />
num2 = gets.chomp.to_i<br />
res1 = num1 - num2<br />
puts res1</blockquote>
<br />
<br />
Now the output will depend on the user input.<br />
Assumed the user typed 3 first and 2 later the result will be 1 as well.]]></description>
			<content:encoded><![CDATA[The easiest way to do subtractions in Ruby is done by passing the values as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 3 - 2</blockquote>
<br />
<br />
The output on the screen will be 1.<br />
<br />
Another way is storing the values in variables and then subtracting one variable from the other as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>num1 = 3<br />
num2 = 2<br />
res1 = num1 - num2<br />
puts res1</blockquote>
<br />
<br />
The output on the screen will be 1, too.<br />
<br />
In case we don't already know the values that should be subtracted<br />
we can ask the user to give us the numbers,<br />
store the user inputs in variables<br />
and then subtract one variable from another as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts "Please enter a number here: "<br />
num1 = gets.chomp.to_i<br />
puts "Please enter another number here: "<br />
num2 = gets.chomp.to_i<br />
res1 = num1 - num2<br />
puts res1</blockquote>
<br />
<br />
Now the output will depend on the user input.<br />
Assumed the user typed 3 first and 2 later the result will be 1 as well.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Predecessor in Ruby]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=2508</link>
			<pubDate>Sun, 28 Feb 2021 11:31:03 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=2508</guid>
			<description><![CDATA[If you want to get the predecessor of a number in Ruby you can do it as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.pred</blockquote>
<br />
<br />
This will print 0 on the screen]]></description>
			<content:encoded><![CDATA[If you want to get the predecessor of a number in Ruby you can do it as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.pred</blockquote>
<br />
<br />
This will print 0 on the screen]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Successor in Ruby]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=2507</link>
			<pubDate>Sun, 28 Feb 2021 11:29:50 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=2507</guid>
			<description><![CDATA[If you want to get the successor of a number in Ruby you can do it as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.succ</blockquote>
<br />
<br />
This will print 2 on the screen]]></description>
			<content:encoded><![CDATA[If you want to get the successor of a number in Ruby you can do it as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.succ</blockquote>
<br />
<br />
This will print 2 on the screen]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Greatest common divisor and least common multiple in Ruby]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=2506</link>
			<pubDate>Sun, 28 Feb 2021 10:13:53 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=2506</guid>
			<description><![CDATA[<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">To get the greatest common divisor and the least common multiple of 2 numbers at the same time </span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">we can use the gcd_lcm function instead of gcd and lcm in two separated functions.</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">In this example we want to know the greatest common divisor </span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">and the least common multiple of 36 and 60.</span></span></span><br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>num1 = 36<br />
num2 = 60<br />
gcd_lcm = num1.gcd_lcm(num2)<br />
<br />
puts gcd_lcm</blockquote>
<br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">This will print 12 and 180 in two lines on the screen.</span></span></span>]]></description>
			<content:encoded><![CDATA[<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">To get the greatest common divisor and the least common multiple of 2 numbers at the same time </span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">we can use the gcd_lcm function instead of gcd and lcm in two separated functions.</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">In this example we want to know the greatest common divisor </span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">and the least common multiple of 36 and 60.</span></span></span><br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>num1 = 36<br />
num2 = 60<br />
gcd_lcm = num1.gcd_lcm(num2)<br />
<br />
puts gcd_lcm</blockquote>
<br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">This will print 12 and 180 in two lines on the screen.</span></span></span>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Least common multiple in Ruby]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=2505</link>
			<pubDate>Sun, 28 Feb 2021 10:11:19 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=2505</guid>
			<description><![CDATA[<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">To get the least common multiple of 2 numbers we can use the lcm function.</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">In this example we want to know the least common multiple of 36 and 60.</span></span></span><br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>num1 = 36<br />
num2 = 60<br />
lcm = num1.lcm(num2)<br />
<br />
puts lcm</blockquote>
<br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">This will print 180 on the screen.</span></span></span>]]></description>
			<content:encoded><![CDATA[<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">To get the least common multiple of 2 numbers we can use the lcm function.</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">In this example we want to know the least common multiple of 36 and 60.</span></span></span><br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>num1 = 36<br />
num2 = 60<br />
lcm = num1.lcm(num2)<br />
<br />
puts lcm</blockquote>
<br />
<br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">This will print 180 on the screen.</span></span></span>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Greatest common divisor in Ruby]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=2504</link>
			<pubDate>Sun, 28 Feb 2021 10:09:40 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=2504</guid>
			<description><![CDATA[To get the greatest common divisor of 2 numbers we can use the gcd function.<br />
In this example we want to know the greatest common divisor of 36 and 60.<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>num1 = 36<br />
num2 = 60<br />
gcd = num1.gcd(num2)<br />
<br />
puts gcd</blockquote>
<br />
<br />
This will print 12 on the screen.]]></description>
			<content:encoded><![CDATA[To get the greatest common divisor of 2 numbers we can use the gcd function.<br />
In this example we want to know the greatest common divisor of 36 and 60.<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>num1 = 36<br />
num2 = 60<br />
gcd = num1.gcd(num2)<br />
<br />
puts gcd</blockquote>
<br />
<br />
This will print 12 on the screen.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Floor and precisions in Ruby]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=2503</link>
			<pubDate>Sun, 28 Feb 2021 09:40:16 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=2503</guid>
			<description><![CDATA[Example 1<br />
Let's assume our number is 12.12 and we want to print the floor without any precision:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 12.12.floor</blockquote>
<br />
<br />
This will print 12 on the screen<br />
<br />
Example 2<br />
Let's assume our number is 12.12 and we want to print the floor with a precision of 1 decimal place:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 12.12.floor(1)</blockquote>
<br />
<br />
This will print 12.1 on the screen<br />
<br />
Example 3<br />
Let's assume our number is 12.12 and we want to print the floor with a precision of 2 decimal places:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 12.12.floor(2)</blockquote>
<br />
<br />
This will print 12.12 on the screen]]></description>
			<content:encoded><![CDATA[Example 1<br />
Let's assume our number is 12.12 and we want to print the floor without any precision:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 12.12.floor</blockquote>
<br />
<br />
This will print 12 on the screen<br />
<br />
Example 2<br />
Let's assume our number is 12.12 and we want to print the floor with a precision of 1 decimal place:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 12.12.floor(1)</blockquote>
<br />
<br />
This will print 12.1 on the screen<br />
<br />
Example 3<br />
Let's assume our number is 12.12 and we want to print the floor with a precision of 2 decimal places:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 12.12.floor(2)</blockquote>
<br />
<br />
This will print 12.12 on the screen]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Ceil and precisions in Ruby]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=2502</link>
			<pubDate>Sun, 28 Feb 2021 09:35:35 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=2502</guid>
			<description><![CDATA[Example 1:<br />
Let's assume our number is 1.1 and we want to print the ceil without any precision:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.1.ceil</blockquote>
<br />
<br />
This will print 2 on the screen, because 1.1 is rounded up to the next whole number.<br />
<br />
Example 2:<br />
Let's assume our number is 1.1 and we want to print the ceil with a precision of 1 decimal place:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.1.ceil(1)</blockquote>
<br />
<br />
This will print 1.1 on the screen, because 1.1 is rounded to the nearest 1st. decimal place.<br />
<br />
Example 3:<br />
Let's assume our number is 1.1 and we want to print the ceil with a precision of 2 decimal places:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.1.ceil(2)</blockquote>
<br />
<br />
This will print 1.11 on the screen, because 1.1 is rounded to the nearest 2nd decimal place.]]></description>
			<content:encoded><![CDATA[Example 1:<br />
Let's assume our number is 1.1 and we want to print the ceil without any precision:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.1.ceil</blockquote>
<br />
<br />
This will print 2 on the screen, because 1.1 is rounded up to the next whole number.<br />
<br />
Example 2:<br />
Let's assume our number is 1.1 and we want to print the ceil with a precision of 1 decimal place:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.1.ceil(1)</blockquote>
<br />
<br />
This will print 1.1 on the screen, because 1.1 is rounded to the nearest 1st. decimal place.<br />
<br />
Example 3:<br />
Let's assume our number is 1.1 and we want to print the ceil with a precision of 2 decimal places:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.1.ceil(2)</blockquote>
<br />
<br />
This will print 1.11 on the screen, because 1.1 is rounded to the nearest 2nd decimal place.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Checking if a number is odd or even in Ruby]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=2501</link>
			<pubDate>Sun, 28 Feb 2021 09:28:40 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=2501</guid>
			<description><![CDATA[Example 1.<br />
Let's see if 1 is even by executing the following code:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.even?</blockquote>
<br />
<br />
This will print "false" on the screen, because 1 is not even.<br />
<br />
Example 2.<br />
Let's see if 2 is even by executing the following code:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 2.even?</blockquote>
<br />
<br />
This will print "true" on the screen, because 2 is even.<br />
<br />
Example 3.<br />
Let's see if 1 is odd by executing the following code:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.odd?</blockquote>
<br />
<br />
This will print "true" on the screen, because 1 is odd.<br />
<br />
Example 4.<br />
Let's see if 2 is odd by executing the following code:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 2.odd?</blockquote>
<br />
<br />
This will print "false" on the screen, because 2 is not odd.]]></description>
			<content:encoded><![CDATA[Example 1.<br />
Let's see if 1 is even by executing the following code:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.even?</blockquote>
<br />
<br />
This will print "false" on the screen, because 1 is not even.<br />
<br />
Example 2.<br />
Let's see if 2 is even by executing the following code:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 2.even?</blockquote>
<br />
<br />
This will print "true" on the screen, because 2 is even.<br />
<br />
Example 3.<br />
Let's see if 1 is odd by executing the following code:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1.odd?</blockquote>
<br />
<br />
This will print "true" on the screen, because 1 is odd.<br />
<br />
Example 4.<br />
Let's see if 2 is odd by executing the following code:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 2.odd?</blockquote>
<br />
<br />
This will print "false" on the screen, because 2 is not odd.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Quotients and remainders in Ruby]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=2499</link>
			<pubDate>Sat, 27 Feb 2021 09:51:41 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=2499</guid>
			<description><![CDATA[After reading the <a href="https://ruby-doc.org/core-3.0.0/Numeric.html#method-i-divmod" target="_blank" rel="noopener" class="mycode_url">official Ruby 3.0.0 documentation</a> I have discovered another cool thing.<br />
Let's assume we want to get the result of 11 / 3 and declare some variables as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num1 = 11</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num2 = 3</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Quotient = Num1 / Num2</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">puts "Quotient: " + Quotient.to_s</span></span></span></blockquote>
<br />
<br />
This will print 3 on the screen.<br />
<br />
Now let's get the remainder of the division as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Option 1: <br />
Num1 = 11</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num2 = 3</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Remainder = Num1 % Num2</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">puts "Remainder: " + Remainder.to_s<br />
<br />
</span></span></span>Option 2:<br />
Num1 = 11<br />
Num2 = 3<br />
Remainder = Num1.remainder(Num2)<br />
puts "Remainder: " + Remainder.to_s</blockquote>
<br />
<br />
Both will print 2 on the screen.<br />
<br />
And then let's put the quotient and the remainder together as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num1 = 11</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num2 = 3</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Quotient = Num1 / Num2</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Remainder = Num1 % Num2</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Quotient_Remainder = "#{Quotient}, #{Remainder}"</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">puts "Quotient and remainder: " + Quotient_Remainder.to_s</span></span></span></blockquote>
<br />
<br />
This will print 3, 2 on the screen.<br />
<br />
And now the cool thing.<br />
When using the divmod function Ruby will calculate the quotient and the remainder at the same time.<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="color: #333333;" class="mycode_color"><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font"><span style="font-size: small;" class="mycode_size"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num1 = 11</span></span></span></span></span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font"><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num2 = 3</span></span></span></span></span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font"><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Quotient_Remainder = Num1.divmod(Num2)</span></span></span></span></span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font"><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">puts "Quotient and remainder: " + Quotient_Remainder.to_s</span></span></span></span></span></span></span></blockquote>
<br />
<br />
This will print [3, 2] on the screen.]]></description>
			<content:encoded><![CDATA[After reading the <a href="https://ruby-doc.org/core-3.0.0/Numeric.html#method-i-divmod" target="_blank" rel="noopener" class="mycode_url">official Ruby 3.0.0 documentation</a> I have discovered another cool thing.<br />
Let's assume we want to get the result of 11 / 3 and declare some variables as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num1 = 11</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num2 = 3</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Quotient = Num1 / Num2</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">puts "Quotient: " + Quotient.to_s</span></span></span></blockquote>
<br />
<br />
This will print 3 on the screen.<br />
<br />
Now let's get the remainder of the division as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Option 1: <br />
Num1 = 11</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num2 = 3</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Remainder = Num1 % Num2</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">puts "Remainder: " + Remainder.to_s<br />
<br />
</span></span></span>Option 2:<br />
Num1 = 11<br />
Num2 = 3<br />
Remainder = Num1.remainder(Num2)<br />
puts "Remainder: " + Remainder.to_s</blockquote>
<br />
<br />
Both will print 2 on the screen.<br />
<br />
And then let's put the quotient and the remainder together as follows:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num1 = 11</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num2 = 3</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Quotient = Num1 / Num2</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Remainder = Num1 % Num2</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Quotient_Remainder = "#{Quotient}, #{Remainder}"</span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">puts "Quotient and remainder: " + Quotient_Remainder.to_s</span></span></span></blockquote>
<br />
<br />
This will print 3, 2 on the screen.<br />
<br />
And now the cool thing.<br />
When using the divmod function Ruby will calculate the quotient and the remainder at the same time.<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite><span style="color: #333333;" class="mycode_color"><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font"><span style="font-size: small;" class="mycode_size"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num1 = 11</span></span></span></span></span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font"><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Num2 = 3</span></span></span></span></span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font"><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">Quotient_Remainder = Num1.divmod(Num2)</span></span></span></span></span></span></span><br />
<span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font"><span style="color: #333333;" class="mycode_color"><span style="font-size: small;" class="mycode_size"><span style="font-size: small;" class="mycode_size"><span style="font-family: Tahoma, Verdana, Arial, sans-serif;" class="mycode_font">puts "Quotient and remainder: " + Quotient_Remainder.to_s</span></span></span></span></span></span></span></blockquote>
<br />
<br />
This will print [3, 2] on the screen.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Getting accurate results when working with integers in Ruby]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=2498</link>
			<pubDate>Sat, 27 Feb 2021 08:35:15 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=2498</guid>
			<description><![CDATA[After reading the <a href="https://ruby-doc.org/core-3.0.0/Integer.html" target="_blank" rel="noopener" class="mycode_url">official Ruby 3.0.0 documentation</a> I have discovered that there are 2 ways to get the square root of a number.<br />
When working with small numbers, both options return the same results,<br />
but when the numbers get bigger the results of Option 2 may be inaccurate as follows:<br />
<br />
Option 1:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>Num1 = Integer.sqrt(10**46)<br />
puts Num1</blockquote>
<br />
<br />
This will put exactly 100000000000000000000000 on the screen.<br />
<br />
Option 2:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>Num1 = Math.sqrt(10**46).floor<br />
puts Num1</blockquote>
<br />
<br />
This will put 99999999999999991611392 on the screen.]]></description>
			<content:encoded><![CDATA[After reading the <a href="https://ruby-doc.org/core-3.0.0/Integer.html" target="_blank" rel="noopener" class="mycode_url">official Ruby 3.0.0 documentation</a> I have discovered that there are 2 ways to get the square root of a number.<br />
When working with small numbers, both options return the same results,<br />
but when the numbers get bigger the results of Option 2 may be inaccurate as follows:<br />
<br />
Option 1:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>Num1 = Integer.sqrt(10**46)<br />
puts Num1</blockquote>
<br />
<br />
This will put exactly 100000000000000000000000 on the screen.<br />
<br />
Option 2:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>Num1 = Math.sqrt(10**46).floor<br />
puts Num1</blockquote>
<br />
<br />
This will put 99999999999999991611392 on the screen.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Executing Ruby in a Linux terminal]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=2497</link>
			<pubDate>Sat, 27 Feb 2021 08:28:06 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=2497</guid>
			<description><![CDATA[I have discovered a little inconvenience when trying to execute Ruby from the Linux terminal with a friend.<br />
The Linux version of Ruby doesn't offer the interactive ruby shell,<br />
so if you want to execute Ruby codes from the built in Linux terminal you have to do the following:<br />
<br />
1. Open the terminal<br />
2. Write some Ruby code in it<br />
3. Save the file i.e. as example.rb<br />
4. Open the file from the terminal]]></description>
			<content:encoded><![CDATA[I have discovered a little inconvenience when trying to execute Ruby from the Linux terminal with a friend.<br />
The Linux version of Ruby doesn't offer the interactive ruby shell,<br />
so if you want to execute Ruby codes from the built in Linux terminal you have to do the following:<br />
<br />
1. Open the terminal<br />
2. Write some Ruby code in it<br />
3. Save the file i.e. as example.rb<br />
4. Open the file from the terminal]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[The difference between print and puts]]></title>
			<link>https://qomplainerzschool.lima-city.de/showthread.php?tid=2496</link>
			<pubDate>Fri, 26 Feb 2021 09:28:06 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://qomplainerzschool.lima-city.de/member.php?action=profile&uid=1">Qomplainerz</a>]]></dc:creator>
			<guid isPermaLink="false">https://qomplainerzschool.lima-city.de/showthread.php?tid=2496</guid>
			<description><![CDATA[Print will print whatever you have in one line on the screen, even if there are multiple lines in your code.<br />
For example:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>print 1 + 2<br />
print 2 + 3</blockquote>
<br />
<br />
This will print the results 3 5 in one line on the screen.<br />
<br />
Puts will print whatever you have in a new line on the screen.<br />
For example:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1 + 2<br />
puts 2 + 3</blockquote>
<br />
<br />
This will print the results<br />
3<br />
5<br />
in two lines on the screen.]]></description>
			<content:encoded><![CDATA[Print will print whatever you have in one line on the screen, even if there are multiple lines in your code.<br />
For example:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>print 1 + 2<br />
print 2 + 3</blockquote>
<br />
<br />
This will print the results 3 5 in one line on the screen.<br />
<br />
Puts will print whatever you have in a new line on the screen.<br />
For example:<br />
<br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>puts 1 + 2<br />
puts 2 + 3</blockquote>
<br />
<br />
This will print the results<br />
3<br />
5<br />
in two lines on the screen.]]></content:encoded>
		</item>
	</channel>
</rss>