Sha256: 96252048f577559df8fedff5f01bfbaba627befc98e70711e151842ec5255ea0

Contents?: true

Size: 792 Bytes

Versions: 2

Compression:

Stored size: 792 Bytes

Contents

# frozen_string_literal: true

require_relative "unary_function"

module Plurimath
  module Math
    module Function
      class Floor < UnaryFunction
        def to_latex
          "\\lfloor #{parameter_one.to_latex} \\rfloor"
        end

        def to_mathml_without_math_tag
          first_value = parameter_one&.to_mathml_without_math_tag
          Utility.update_nodes(
            Utility.ox_element("mrow"),
            [
              Utility.ox_element("mo") << "&#x230a;",
              first_value,
              Utility.ox_element("mo") << "&#x230b;",
            ],
          )
        end

        def to_omml_without_math_tag
          [
            r_element("⌊"),
            omml_value,
            r_element("⌋"),
          ]
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
plurimath-0.3.9 lib/plurimath/math/function/floor.rb
plurimath-0.3.8 lib/plurimath/math/function/floor.rb