Class: Float
- Inherits:
-
Object
- Object
- Float
- Defined in:
- lib/gs2crmod/gs2.rb
Overview
ep CodeRunner::Gs2CycloneRun.ancestors
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
necessary because of netcdf quirks.
- #==(other) ⇒ Object
Instance Method Details
#<=>(other) ⇒ Object
necessary because of netcdf quirks
1305 1306 1307 1308 1309 1310 1311 1312 1313 |
# File 'lib/gs2crmod/gs2.rb', line 1305 def <=>(other) # necessary because of netcdf quirks d = (self - other) if d.abs / (self.abs + 1) < 1e-10 return 0 else return (d / d.abs).to_i end end |
#==(other) ⇒ Object
1314 1315 1316 1317 |
# File 'lib/gs2crmod/gs2.rb', line 1314 def ==(other) return false unless other.kind_of? Numeric return (self - other).abs < 1e-14 end |