Quiz of the Day

LiveEdu Quiz of the Day: 06/01/2017

Ruby Quiz

Answer:

D)

The Ruby Math module provides the Ruby programmer with an extensive range of methods for performing mathematical tasks. In addition, the Math module includes two commonly used mathematical constants:

Math::PI
=> 3.14159265358979

Math::E
=> 2.71828182845905

As mentioned previously, Ruby provides an extensive range of math related methods. These are listed and described in the following table.

Method name Description
Math.acos, Math.acos! Arc cosine
Math.acosh, Math.acosh! Hyperbolic arc cosine
Math.asin, Math.asin! Arc sine
Math.asinh, Math.asinh Hyperbolic arc sine
Math.atan, Math.atan!, Math.atan2, Math.atan2! Arc tangent. atan takes an x argument. atan2 takes x and y arguments
Math.atanh, Math.atanh! Hyperbolic arc tangent
Math.cos, Math.cos! Cosine
Math.cosh, Math.cosh Hyperbolic cosine
Math.sin, Math.sin! Sine
Math.erf Error function
Match.erfc Complementary error function
Math.exp, Math.exp! Base x of Euler
Math.frexp Normalized fraction and exponent
Math.hypot Hypotenuse
Math.ldexp Floating-point value corresponding to mantissa and exponent
Math.sinh, Math.sinh! Hyperbolic sine
Math.sqrt, Math.sqrt! Square root
Math.tan, Math.tan! Tangent
Math.tanh, Math.tanh! Hyperbolic tangent

Now that we have a list of the math methods available to us, we can start to use them:

To perform a square root:

Math.sqrt(9)
=> 3.0

Or a Euler calculation:

Math.exp(2)
=> 7.38905609893065

If you want to explore more, visit our Ruby edu & tutorials section!

Below are some examples:

Building a Ruby on Rails app for managing students

Trello clone app in Ruby

Dr. Michael J. Garbade

I, Dr. Michael J. Garbade is the co-founder of the Education Ecosystem (aka LiveEdu), ex-Amazon, GE, Rebate Networks, Y-combinator. Python, Django, and DevOps Engineer. Serial Entrepreneur. Experienced in raising venture funding. I speak English and German as mother tongues. I have a Masters in Business Administration and Physics, and a Ph.D. in Venture Capital Financing. Currently, I am the Project Lead on the community project -Nationalcoronalvirus Hotline I write subject matter expert technical and business articles in leading blogs like Opensource.com, Dzone.com, Cybrary, Businessinsider, Entrepreneur.com, TechinAsia, Coindesk, and Cointelegraph. I am a frequent speaker and panelist at tech and blockchain conferences around the globe. I serve as a start-up mentor at Axel Springer Accelerator, NY Edtech Accelerator, Seedstars, and Learnlaunch Accelerator. I love hackathons and often serve as a technical judge on hackathon panels.

Recent Posts

Highest Stable Coin Yields – (W16 – 2024)

Another week to bring you the top yield platforms for three of the most prominent…

2 weeks ago

LEDU Token OTC Trading

If you hold a large volume of LEDU tokens above 1 million units and wish…

1 month ago

Highest Stable Coin Yields – (W12 – 2024)

It’s another week and like always we have to explore the top yield platforms for…

1 month ago

Binance Auto Invest – the Best Innovation in Crypto since Sliced Bread

At a time where we’re constantly seeking tools and strategies to simplify our crypto investments,…

1 month ago

Highest Stable Coin Yields – March 2024

As we kick off another week, it's time to explore the top yield platforms for…

2 months ago

Education Ecosystem Featured on Business Insider

We're excited to share that Education Ecosystem was recently featured in an article on Business…

2 months ago