source and string formatting
This commit is contained in:
parent
de89407e41
commit
0e7fbcc341
1 changed files with 3 additions and 1 deletions
|
@ -23,6 +23,7 @@ module Rpl
|
|||
[stack, dictionary]
|
||||
end
|
||||
|
||||
# https://rosettacode.org/wiki/Trigonometric_functions#Ruby
|
||||
# arg sinus
|
||||
def arg_sinus( stack, dictionary )
|
||||
# # Handle angles with no tangent.
|
||||
|
@ -31,7 +32,8 @@ module Rpl
|
|||
|
||||
# # Tangent of angle is y / x, where x^2 + y^2 = 1.
|
||||
# atan(y / sqrt(1 - y * y, prec), prec)
|
||||
stack << { value: '«
|
||||
stack << { value: '
|
||||
«
|
||||
dup abs 1 ==
|
||||
« pi 2 / * »
|
||||
« dup sq 1 swap - sqrt / atan »
|
||||
|
|
Loading…
Reference in a new issue