simplify D→R and R→D, fix R→D test
This commit is contained in:
parent
77946e56f7
commit
a512979e91
2 changed files with 4 additions and 4 deletions
|
@ -91,7 +91,7 @@ module Rpl
|
|||
|
||||
# convert degrees to radians
|
||||
def degrees_to_radians( stack, dictionary )
|
||||
stack << { value: '𝛑 * 180 /',
|
||||
stack << { value: '𝛑 180 / *',
|
||||
type: :program }
|
||||
|
||||
Rpl::Lang::Core.eval( stack, dictionary )
|
||||
|
@ -99,7 +99,7 @@ module Rpl
|
|||
|
||||
# convert radians to degrees
|
||||
def radians_to_degrees( stack, dictionary )
|
||||
stack << { value: '180 * 𝛑 /',
|
||||
stack << { value: '𝛑 180 / /',
|
||||
type: :program }
|
||||
|
||||
Rpl::Lang::Core.eval( stack, dictionary )
|
||||
|
|
|
@ -64,8 +64,8 @@ class TesttLanguageOperations < Test::Unit::TestCase
|
|||
|
||||
def test_r→d
|
||||
lang = Rpl::Language.new
|
||||
lang.run '2.6179938780 r→d'
|
||||
assert_equal [{ value: 150, type: :numeric, base: 10 }],
|
||||
lang.run 'pi r→d'
|
||||
assert_equal [{ value: 180, type: :numeric, base: 10 }],
|
||||
lang.stack
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue