Ruby | BigDecimal E() function Last Updated : 05 Dec, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 : Ruby # 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" Output : BigDecimal a E method : 0.2718281828E1 BigDecimal b E method : 0.27182818284590452353602874713527E1 BigDecimal c E method : 0.3E1 Example #2 : Ruby # 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" Output : BigDecimal a E method : 0.271828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746639193200305992E1 BigDecimal b E method : 0.3E1 BigDecimal c E method : 0.272E1 Comment More infoAdvertise with us Next Article Ruby | BigDecimal PI() function M mayank5326 Follow Improve Article Tags : Ruby Ruby-Methods Ruby BigDecimal-class Similar Reads Ruby | BigDecimal exp() function BigDecimal#exp() : exp() is a BigDecimal class method which returns the value of e (the base of natural logarithms) raised to the power of decimal, to the specified number of digits of precision. Syntax: BigDecimal.exp() Parameter: BigDecimal values Return: the value of e (the base of natural logari 2 min read Ruby | BigDecimal cos() function BigDecimal#cos() : cos() is a BigDecimal class method which returns the value of cosine to the specified number of digits of precision, numeric. Syntax: BigDecimal.cos() Parameter: BigDecimal values Return: the value of cosine to the specified number of digits of precision, numeric. Example #1 : Exa 2 min read Ruby | BigDecimal to_f() function BigDecimal#to_f() : to_f() is a BigDecimal class method which returns a new Float object having approximately the same value as the BigDecimal number. Syntax: BigDecimal.to_f() Parameter: BigDecimal values Return: a new Float object having approximately the same value as the BigDecimal number. Examp 2 min read Ruby | BigDecimal PI() function BigDecimal#PI() : PI() is a BigDecimal class method which returns the value of pi to the specified number of digits of precision, numeric. Syntax: BigDecimal.PI() Parameter: BigDecimal values Return: the value of pi to the specified number of digits of precision, numeric. Example #1 : Ruby # Ruby co 2 min read Ruby | BigDecimal to_d() function BigDecimal#to_d() : to_d() is a BigDecimal class method which returns the self of Big decimal. Syntax: BigDecimal.to_d() Parameter: BigDecimal values Return: the self of Big decimal. Example #1 : Ruby # Ruby code for BigDecimal.to_d() method # loading library require 'bigdecimal' require 'bigdecimal 1 min read Ruby | BigDecimal log() function BigDecimal#log() : log() is a BigDecimal class method which returns the natural logarithm of decimal to the specified number of digits of precision, numeric. Syntax: BigDecimal.log() Parameter: BigDecimal values Return: the natural logarithm of decimal to the specified number of digits of precision, 2 min read Like