# File lib/compass/core/sass_extensions/functions/math.rb, line 50 def acos(number) trig(:acos, number) end
# File lib/compass/core/sass_extensions/functions/math.rb, line 40 def asin(number) trig(:asin, number) end
# File lib/compass/core/sass_extensions/functions/math.rb, line 60 def atan(number) trig(:atan, number) end
# File lib/compass/core/sass_extensions/functions/math.rb, line 45 def cos(number) trig(:cos, number) end
# File lib/compass/core/sass_extensions/functions/math.rb, line 20 def deprecated_random(*args) if args.length == 2 Compass::Util.compass_warn WARNING: The $start value for random(#{args.first}, #{args.last}) is not supported by Sass and is now deprecated in Compass and will be removed in a future release. Use `#{args.first} + random(#{args.last.minus(args.first)})` instead. range = (args.first.value..args.last.value).to_a number(range[rand(range.length)]) else sass_random(*args) end end
# File lib/compass/core/sass_extensions/functions/math.rb, line 65 def e E end
# File lib/compass/core/sass_extensions/functions/math.rb, line 70 def logarithm(number, base = e ) assert_type number, :Number assert_type base, :Number raise Sass::SyntaxError, "base to logarithm must be unitless." unless base.unitless? result = Math.log(number.value, base.value) rescue Math.log(number.value) / Math.log(base.value) number(result, number.unit_str) end
# File lib/compass/core/sass_extensions/functions/math.rb, line 15 def pi() PI end
# File lib/compass/core/sass_extensions/functions/math.rb, line 89 def pow(number, exponent) assert_type number, :Number assert_type exponent, :Number raise Sass::SyntaxError, "exponent to pow must be unitless." unless exponent.unitless? number(number.value**exponent.value, number.unit_str) end
# File lib/compass/core/sass_extensions/functions/math.rb, line 35 def sin(number) trig(:sin, number) end
# File lib/compass/core/sass_extensions/functions/math.rb, line 81 def sqrt(number) numeric_transformation(number) { |n| Math.sqrt(n) } end
Generated with the Darkfish Rdoc Generator 2.