Sha256: 19294423e9412a3a88c08860c526a15c6e547fff5618c57aaf2bbb4c4c075337

Contents?: true

Size: 808 Bytes

Versions: 22

Compression:

Stored size: 808 Bytes

Contents

#!/usr/bin/env ruby
require("gsl")
include GSL

puts("e")
p GSL::M_E
p Math::exp(1)


puts("log10(e)")
p GSL::M_LOG10E
p Math::log10(M_E)

puts("sqrt(2)")
p GSL::M_SQRT2
p Math::sqrt(2)

puts("sqrt(1/2)")
p GSL::M_SQRT1_2
p Math::sqrt(1.0/2)

puts("sqrt(3)")
p GSL::M_SQRT3
p Math::sqrt(3)

puts("pi")
p GSL::M_PI
p Math::PI

puts("pi/2")
p GSL::M_PI_2
p Math::PI/2.0

puts("pi/4")
p GSL::M_PI_4
p Math::PI/4.0

puts("sqrt(pi)")
p GSL::M_SQRTPI
p Math::sqrt(Math::PI)

puts("2/sqrt(pi)")
p GSL::M_2_SQRTPI
p 2.0/Math::sqrt(Math::PI)

puts("1/pi")
p GSL::M_1_PI
p 1.0/Math::PI

puts("2/pi")
p GSL::M_2_PI
p 2.0/Math::PI

puts("ln10")
p GSL::M_LN10
p Math::log(10)

puts("ln2")
p GSL::M_LN2
p Math::log(2)

puts("ln(pi)")
p GSL::M_LNPI
p Math::log(Math::PI)

puts("euler constant 0.5772156...")
p GSL::M_EULER

Version data entries

22 entries across 22 versions & 4 rubygems

Version Path
gsl-2.1.0.3 examples/math/const.rb
gsl-2.1.0.2 examples/math/const.rb
gsl-2.1.0.1 examples/math/const.rb
gsl-2.1.0 examples/math/const.rb
gsl-1.16.0.6 examples/math/const.rb
rb-gsl-1.16.0.5 examples/math/const.rb
rb-gsl-1.16.0.4 examples/math/const.rb
rb-gsl-1.16.0.3 examples/math/const.rb
rb-gsl-1.16.0.3.rc1 examples/math/const.rb
gsl-nmatrix-1.15.3.2 examples/math/const.rb
gsl-nmatrix-1.15.3.1 examples/math/const.rb
rb-gsl-1.16.0.2 examples/math/const.rb
rb-gsl-1.16.0.1 examples/math/const.rb
rb-gsl-1.16.0 examples/math/const.rb
rb-gsl-1.15.3.2 examples/math/const.rb
rb-gsl-1.15.3.1 examples/math/const.rb
blackwinter-gsl-1.15.3.2 examples/math/const.rb
gsl-nmatrix-1.15.3.0 examples/math/const.rb
gsl-1.15.3 examples/math/const.rb
gsl-1.14.7 examples/math/const.rb