Class JBLAS::ReversedArithmetic
In: lib/jblas/arith.rb
Parent: Object

When arguments to arithmetic operators are promoted via coerce, they change their order. This class is a wrapper for the promoted self which has - and / overloaded to call rsub and rdiv instead of div and sub

Methods

*   +   -   /   new  

Public Class methods

[Source]

# File lib/jblas/arith.rb, line 42
    def initialize(o)
      @value = o;
    end

Public Instance methods

[Source]

# File lib/jblas/arith.rb, line 50
    def *(o)
      @value.mul o
    end

[Source]

# File lib/jblas/arith.rb, line 46
    def +(o)
      @value.add o
    end

[Source]

# File lib/jblas/arith.rb, line 54
    def -(o)
      @value.rsub o
    end

[Source]

# File lib/jblas/arith.rb, line 58
    def /(o)
      @value.rdiv o
    end

[Validate]