Class: CAS::PI_CONSTANT

Inherits:
Constant show all
Defined in:
lib/numbers/constants.rb

Overview

Class that represents the constant Pi (π)

Instance Attribute Summary

Attributes inherited from Op

#x

Instance Method Summary collapse

Methods inherited from Constant

#==, #args, #call, #depend?, #diff, #inspect, #simplify, #subs, #to_dot

Methods inherited from Op

#!=, #*, #**, #+, #-, #-@, #/, #==, #args, #as_proc, #call, #depend?, #diff, #dot_graph, #equal, #greater, #greater_equal, init_simplify_dict, #inspect, #limit, numeric_to_const, #simplify, simplify_dict, #simplify_dictionary, #smaller, #smaller_equal, #subs, #to_c_lib, #to_code

Constructor Details

#initializePI_CONSTANT

Initializer for the pi constant

* **returns**: `CAS::PI_CONSTANT` new instance


229
230
231
# File 'lib/numbers/constants.rb', line 229

def initialize
  @x = Math::PI
end

Instance Method Details

#to_sObject

String representation for the constant

* **returns**: `String`


236
237
238
# File 'lib/numbers/constants.rb', line 236

def to_s
  "π"
end