Class: Float
- Inherits:
-
Object
- Object
- Float
- Defined in:
- lib/gs2crmod/gs2.rb
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
necessary because of netcdf quirks.
- #==(other) ⇒ Object
Instance Method Details
#<=>(other) ⇒ Object
necessary because of netcdf quirks
1422 1423 1424 1425 1426 1427 1428 1429 1430 |
# File 'lib/gs2crmod/gs2.rb', line 1422 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
1431 1432 1433 1434 |
# File 'lib/gs2crmod/gs2.rb', line 1431 def ==(other) return false unless other.kind_of? Numeric return (self - other).abs < 1e-14 end |