This chapter concerns the ruby extension only!
One class and some ruby methods are directly defined in ruby language. This part of the programming concerns the operators in which the second argument is a ``Result'' object, but the first argument has another type (Real, Complex, Array...). Then, a ruby type coercion is performed thanks to the ``Result'' class ``coerce'' method. This small part of code allows to perform the operations using the different ``Post.op???'' methods.
This part of FeResPost is programmed in the ``FeResPost.rb'' file. content looks as follows:
# encoding: utf-8 require "FeResPost.so" module FeResPost class ROpResult @x=nil def initialize(res) @x=res end def +(other) return Post.opAdd(other,@x) end def -(other) return Post.opSub(other,@x) end def *(other) return Post.opMul(other,@x) end def /(other) return Post.opDiv(other,@x) end def **(other) return Post.pow(other,@x) end end class Result def coerce(x) [ROpResult.new(self),x] end end # Result end # FeResPost puts "End \"FeResPost\" module initialization.\n" puts "\n\n"