Class: Float

Inherits:
Object
  • Object
show all
Defined in:
lib/gs2crmod/gs2.rb

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object

necessary because of netcdf quirks



1401
1402
1403
1404
1405
1406
1407
1408
1409
# File 'lib/gs2crmod/gs2.rb', line 1401

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



1410
1411
1412
1413
# File 'lib/gs2crmod/gs2.rb', line 1410

def ==(other)
        return false unless other.kind_of? Numeric
    return (self - other).abs < 1e-14
end