Ruby | BigDecimal E() function

BigDecimal#E() : E() is a BigDecimal class method which returns the value of arctangent to the specified number of digits of precision, numeric.

Syntax: BigDecimal.E()

Parameter: BigDecimal values



Return: the value of arctangent to the specified number of digits of precision, numeric.

Example #1 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# Ruby code for BigDecimal.E() method
  
# loading library
require 'bigdecimal'
require 'bigdecimal/util'
  
require "bigdecimal/math"
  
include BigMath
  
# declaring bigdecimal
a = BigMath.E(BigDecimal("10")).to_s
  
# declaring bigdecimal
b = BigMath.E(BigDecimal("032")).to_s
  
# declaring bigdecimal
c = BigMath.E(BigDecimal("1")).to_s
  
  
# E() method
puts "BigDecimal a E method : #{a}\n\n"
  
puts "BigDecimal b E method : #{b}\n\n"
  
puts "BigDecimal c E method : #{c}\n\n"

chevron_right


Output :

BigDecimal a E method : 0.2718281828E1

BigDecimal b E method : 0.27182818284590452353602874713527E1

BigDecimal c E method : 0.3E1

Example #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# Ruby code for BigDecimal.E() method
  
# loading library
require 'bigdecimal'
require 'bigdecimal/util'
  
require "bigdecimal/math"
  
include BigMath
  
# declaring bigdecimal
a = BigMath.E(BigDecimal("120")).to_s
  
# declaring bigdecimal
b = BigMath.E(BigDecimal("1.0")).to_s
  
# declaring bigdecimal
c = BigMath.E(BigDecimal("3")).to_s
  
# E() method
puts "BigDecimal a E method : #{a}\n\n"
  
puts "BigDecimal b E method : #{b}\n\n"
  
puts "BigDecimal c E method : #{c}\n\n"

chevron_right


Output :

BigDecimal a E method : 0.271828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746639193200305992E1

BigDecimal b E method : 0.3E1

BigDecimal c E method : 0.272E1




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.