summaryrefslogtreecommitdiff
path: root/ruby/test/Ice/operations/Twoways.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ruby/test/Ice/operations/Twoways.rb')
-rw-r--r--ruby/test/Ice/operations/Twoways.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/ruby/test/Ice/operations/Twoways.rb b/ruby/test/Ice/operations/Twoways.rb
index 453a048b219..2ac21be3874 100644
--- a/ruby/test/Ice/operations/Twoways.rb
+++ b/ruby/test/Ice/operations/Twoways.rb
@@ -135,11 +135,19 @@ def twoways(communicator, p)
r, f, d = p.opFloatDouble(3.402823466E38, 0.0)
r, f, d = p.opFloatDouble(-3.402823466E38, 0.0)
- for val in [Float::NAN, -Float::NAN]
+ #
+ # For portability, don't use Float::NAN here.
+ #
+ nan = 0.0 / 0.0
+ for val in [nan, -nan]
r, f, d = p.opFloatDouble(val, val)
test(r.nan? && f.nan? && d.nan?)
end
- for val in [Float::INFINITY, -Float::INFINITY]
+ #
+ # For portability, don't use Float::INFINITY here.
+ #
+ inf = 1.0 / 0.0
+ for val in [inf, -inf]
r, f, d = p.opFloatDouble(val, val)
test(r.infinite? != 0 && f.infinite? != 0 && d.infinite? != 0)
end