Class: AppMath::Cos

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

Instance Method Summary collapse

Constructor Details

#initialize(n = R.prec) ⇒ Cos

Returns a new instance of Cos.



307
308
309
310
# File 'lib/graph.rb', line 307

def initialize(n = R.prec)
  @precMem = R.prec
  @precLoc = n
end

Instance Method Details

#at(x) ⇒ Object



311
312
313
314
315
# File 'lib/graph.rb', line 311

def at(x)
  R.prec = @precLoc
  y = R.c(x).cos
  R.prec = @precMem; y
end