Skip to content

Commit

Permalink
TESTS: added tests of casting function arguments to float32-test.reds
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterWAWood committed Feb 29, 2012
1 parent 5c61a62 commit a2c30a5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions red-system/tests/source/units/float32-test.reds
Original file line number Diff line number Diff line change
Expand Up @@ -265,5 +265,27 @@ Red/System [

===end-group===

===start-group=== "Casting float! arguments to float32!"

cfaf1: function [
a [float!]
return: [float32!]
][
as float32! a
]
cfaf2: function [
a [float!]
b [float!]
return: [float32!]
][
(as float32! a) + (as float32! b)
]

--test-- "cfaf1"
--assert (as float32! 1.0) = cfaf1 1.0

--test-- "cfaf2"
--assertf32~= (as float32! 3.0) (cfaf2 1.0 2.0) (as float32! 0.1e-7)


~~~end-file~~~

0 comments on commit a2c30a5

Please sign in to comment.