QuadraticEquation_MS 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/quadraticEquation_MS.rb +20 -0
- metadata +46 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e370cbea489fe04d7ba7342f6453b819665485d1
|
4
|
+
data.tar.gz: 85c29989d0cd3cc397b676231e294a22b62691db
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b6a185c18607b7ade0c444f1d4688364b3170799a105f786a96c074153256bb8a2464d48384bd6bb9050dced25a3ceb46cf45194972a8b4c399ae5c08132ab38
|
7
|
+
data.tar.gz: 3e1976992338b8a2794cbcf6764158e7c24d325bfa99a58c557830811ee63cf0004f6825ccc95d81c1ddddec47b372287d448a4852b4aeb9b5cdaeb887e8f123
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Quadratic Equation formaula
|
2
|
+
class QuadraticEquation_MS
|
3
|
+
# QuadraticEquation
|
4
|
+
#Example:
|
5
|
+
# QuadraticEquation_MS.new 2, 2, 2
|
6
|
+
#
|
7
|
+
# Arguments:
|
8
|
+
# a, b ,c : number
|
9
|
+
def self.new a=0, b=0, c=0
|
10
|
+
result= []
|
11
|
+
if a == 0 || b == 0 || c ==0
|
12
|
+
puts "a, b or c values can't be nil or 0"
|
13
|
+
else
|
14
|
+
result[0] = -b + (((b**2) - (4 * b * c))/(2*a)) ** (1/2)
|
15
|
+
result[1] = -b - (((b**2) - (4 * b * c))/(2*a)) ** (1/2)
|
16
|
+
end
|
17
|
+
result
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: QuadraticEquation_MS
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mahdi Saeed
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-08 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Quadratic Equation solution, pass the 3 values a, b, c and results pass
|
14
|
+
back as an array
|
15
|
+
email:
|
16
|
+
- mahadi@gmail.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- lib/quadraticEquation_MS.rb
|
22
|
+
homepage: http://rubygems.org/gems/quadraticEquation_MS
|
23
|
+
licenses:
|
24
|
+
- MIT
|
25
|
+
metadata: {}
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- lib
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
requirements: []
|
41
|
+
rubyforge_project:
|
42
|
+
rubygems_version: 2.1.11
|
43
|
+
signing_key:
|
44
|
+
specification_version: 4
|
45
|
+
summary: Quadratic Equation formaula
|
46
|
+
test_files: []
|