Module: Rampi::Functions
- Included in:
- DSL
- Defined in:
- lib/rampi/functions.rb
Instance Method Summary collapse
-
#abs(arg) ⇒ Object
Absolute value (added in pd 0.3).
-
#acos(arg) ⇒ Object
Arc cosine.
-
#acosh ⇒ Object
Inverse hyperbolic cosine.
-
#asin(arg) ⇒ Object
Arc sine.
-
#asinh ⇒ Object
Inverse hyperbolic sine.
-
#atan(arg) ⇒ Object
Arc tangent.
-
#atan2(arg1, arg2) ⇒ Object
Arc tangent of 2 variables.
-
#atanh ⇒ Object
Inverse hyperbolic tangent.
-
#cbrt(arg) ⇒ Object
Cube root (added in pd 0.4).
-
#ceil(arg) ⇒ Object
Smallest integral value not less than argument (added in pd 0.4).
-
#cos(arg) ⇒ Object
Cosine.
-
#cosh ⇒ Object
Hyperbolic cosine.
-
#drem(arg1, arg2) ⇒ Object
Floating-point remainder function (added in versio n 0.4).
-
#exp(arg) ⇒ Object
e raised to the power of
arg
. -
#expm1(arg) ⇒ Object
Exponential minus 1 (added in pd 0.4).
-
#fact(arg) ⇒ Object
Factorial of
arg
. -
#float(arg) ⇒ Object
Convert to float.
-
#floor(arg) ⇒ Object
Largest integral value not greater than argument (added in pd 0.4).
-
#fmod(arg) ⇒ Object
Floating-point remainder function (added in pd 0.4).
-
#if(cond, true_exp, false_exp) ⇒ Object
Conditional - if (condition, IfTrue-expr, IfFalse-expr).
-
#imodf(arg) ⇒ Object
Get signed intergar value from floating point number(added in version 0.4).
-
#int(arg) ⇒ Object
Convert to integer.
-
#ldexp(arg) ⇒ Object
Multiply floating-point number by integral power of 2 (added in pd 0.4).
-
#ln(arg) ⇒ Object
(also: #log)
Natural log.
-
#log10(arg) ⇒ Object
Log base 10.
-
#log1p(arg) ⇒ Object
Logarithm of 1 plus (added in pd 0.4).
-
#max(arg1, arg2) ⇒ Object
Maximum value between
x
andy
. -
#min(arg1, arg2) ⇒ Object
Minimum value between
arg1
andarg2
. -
#modf(arg) ⇒ Object
Get signed fractional value from floating-point number(added in version 0.4).
-
#pow(arg1, arg2) ⇒ Object
Raise
arg1
to the power ofarg2
. -
#rint(arg) ⇒ Object
Round a float to a nearby integer.
-
#sin(arg) ⇒ Object
Sine.
-
#sinh ⇒ Object
Hyperbolic sine.
-
#sqrt(arg1) ⇒ Object
Square root of
x
. -
#tan(arg) ⇒ Object
Tangent.
-
#tanh ⇒ Object
Hyperbolic tangent.
Instance Method Details
#abs(arg) ⇒ Object
Absolute value (added in pd 0.3)
30 31 32 |
# File 'lib/rampi/functions.rb', line 30 def abs(arg) Func.new(:abs, arg) end |
#acos(arg) ⇒ Object
Arc cosine
156 157 158 |
# File 'lib/rampi/functions.rb', line 156 def acos(arg) Func.new(:acos, arg) end |
#acosh ⇒ Object
Inverse hyperbolic cosine
191 192 193 |
# File 'lib/rampi/functions.rb', line 191 def acosh() Func.new(:acosh, arg) end |
#asin(arg) ⇒ Object
Arc sine
151 152 153 |
# File 'lib/rampi/functions.rb', line 151 def asin(arg) Func.new(:asin, arg) end |
#asinh ⇒ Object
Inverse hyperbolic sine
186 187 188 |
# File 'lib/rampi/functions.rb', line 186 def asinh() Func.new(:asinh, arg) end |
#atan(arg) ⇒ Object
Arc tangent
161 162 163 |
# File 'lib/rampi/functions.rb', line 161 def atan(arg) Func.new(:atan, arg) end |
#atan2(arg1, arg2) ⇒ Object
Arc tangent of 2 variables
166 167 168 |
# File 'lib/rampi/functions.rb', line 166 def atan2(arg1, arg2) Func.new(:atan2, arg1, arg2) end |
#atanh ⇒ Object
Inverse hyperbolic tangent
196 197 198 |
# File 'lib/rampi/functions.rb', line 196 def atanh() Func.new(:atanh, arg) end |
#cbrt(arg) ⇒ Object
Cube root (added in pd 0.4)
112 113 114 |
# File 'lib/rampi/functions.rb', line 112 def cbrt(arg) Func.new(:cbrt, arg) end |
#ceil(arg) ⇒ Object
Smallest integral value not less than argument (added in pd 0.4)
50 51 52 |
# File 'lib/rampi/functions.rb', line 50 def ceil(arg) Func.new(:ceil, arg) end |
#cos(arg) ⇒ Object
Cosine
141 142 143 |
# File 'lib/rampi/functions.rb', line 141 def cos(arg) Func.new(:cos, arg) end |
#cosh ⇒ Object
Hyperbolic cosine
176 177 178 |
# File 'lib/rampi/functions.rb', line 176 def cosh() Func.new(:cosh, arg) end |
#drem(arg1, arg2) ⇒ Object
Floating-point remainder function (added in versio n 0.4)
70 71 72 |
# File 'lib/rampi/functions.rb', line 70 def drem(arg1, arg2) Func.new(:drem, arg1, arg2) end |
#exp(arg) ⇒ Object
e raised to the power of arg
91 92 93 |
# File 'lib/rampi/functions.rb', line 91 def exp(arg) Func.new(:exp, arg) end |
#expm1(arg) ⇒ Object
Exponential minus 1 (added in pd 0.4)
117 118 119 |
# File 'lib/rampi/functions.rb', line 117 def expm1(arg) Func.new(:expm1, arg) end |
#fact(arg) ⇒ Object
Factorial of arg
107 108 109 |
# File 'lib/rampi/functions.rb', line 107 def fact(arg) Func.new(:fact, arg) end |
#float(arg) ⇒ Object
Convert to float
25 26 27 |
# File 'lib/rampi/functions.rb', line 25 def float(arg) Func.new(:float, arg) end |
#floor(arg) ⇒ Object
Largest integral value not greater than argument (added in pd 0.4)
45 46 47 |
# File 'lib/rampi/functions.rb', line 45 def floor(arg) Func.new(:floor, arg) end |
#fmod(arg) ⇒ Object
Floating-point remainder function (added in pd 0.4)
55 56 57 |
# File 'lib/rampi/functions.rb', line 55 def fmod(arg) Func.new(:fmod, arg) end |
#if(cond, true_exp, false_exp) ⇒ Object
Conditional - if (condition, IfTrue-expr, IfFalse-expr)
10 11 12 |
# File 'lib/rampi/functions.rb', line 10 def if(cond, true_exp, false_exp) Func.new(:if, cond, true_exp, false_exp) end |
#imodf(arg) ⇒ Object
Get signed intergar value from floating point number(added in version 0.4)
60 61 62 |
# File 'lib/rampi/functions.rb', line 60 def imodf(arg) Func.new(:imodf, arg) end |
#int(arg) ⇒ Object
Convert to integer
15 16 17 |
# File 'lib/rampi/functions.rb', line 15 def int(arg) Func.new(:int, arg) end |
#ldexp(arg) ⇒ Object
Multiply floating-point number by integral power of 2 (added in pd 0.4)
127 128 129 |
# File 'lib/rampi/functions.rb', line 127 def ldexp(arg) Func.new(:ldexp, arg) end |
#ln(arg) ⇒ Object Also known as: log
Natural log
96 97 98 |
# File 'lib/rampi/functions.rb', line 96 def ln(arg) Func.new(:ln, arg) end |
#log10(arg) ⇒ Object
Log base 10
102 103 104 |
# File 'lib/rampi/functions.rb', line 102 def log10(arg) Func.new(:log10, arg) end |
#log1p(arg) ⇒ Object
Logarithm of 1 plus (added in pd 0.4)
122 123 124 |
# File 'lib/rampi/functions.rb', line 122 def log1p(arg) Func.new(:log1p, arg) end |
#max(arg1, arg2) ⇒ Object
Maximum value between x
and y
40 41 42 |
# File 'lib/rampi/functions.rb', line 40 def max(arg1, arg2) Func.new(:max, arg1, arg2) end |
#min(arg1, arg2) ⇒ Object
Minimum value between arg1
and arg2
35 36 37 |
# File 'lib/rampi/functions.rb', line 35 def min(arg1, arg2) Func.new(:min, arg1, arg2) end |
#modf(arg) ⇒ Object
Get signed fractional value from floating-point number(added in version 0.4)
65 66 67 |
# File 'lib/rampi/functions.rb', line 65 def modf(arg) Func.new(:modf, arg) end |
#pow(arg1, arg2) ⇒ Object
Raise arg1
to the power of arg2
80 81 82 |
# File 'lib/rampi/functions.rb', line 80 def pow(arg1, arg2) Func.new(:pow, arg1, arg2) end |
#rint(arg) ⇒ Object
Round a float to a nearby integer
20 21 22 |
# File 'lib/rampi/functions.rb', line 20 def rint(arg) Func.new(:rint, arg) end |
#sin(arg) ⇒ Object
Sine
136 137 138 |
# File 'lib/rampi/functions.rb', line 136 def sin(arg) Func.new(:sin, arg) end |
#sinh ⇒ Object
Hyperbolic sine
171 172 173 |
# File 'lib/rampi/functions.rb', line 171 def sinh() Func.new(:sinh, arg) end |
#sqrt(arg1) ⇒ Object
Square root of x
85 86 87 |
# File 'lib/rampi/functions.rb', line 85 def sqrt(arg1) Func.new(:sqrt, arg1) end |