Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/BOAST/Language/Algorithm.rb

Instance Method Summary collapse

Instance Method Details

#to_varObject

Creates a constant BOAST Int Variable with a name corresponding to its value. The variable is signed only when negative.



214
215
216
217
218
219
220
221
222
# File 'lib/BOAST/Language/Algorithm.rb', line 214

def to_var
  if self < 0 then
     v = BOAST::Variable::new("#{self}", BOAST::Int, :signed => true, :constant => self )
   else
     v = BOAST::Variable::new("#{self}", BOAST::Int, :signed => false, :constant => self )
  end
  v.force_replace_constant = true
  return v
end