GRAYBYTE WORDPRESS FILE MANAGER6052

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/alt/ruby24/lib64/ruby/2.4.0/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/alt/ruby24/lib64/ruby/2.4.0//mathn.rb
# frozen_string_literal: false
#--
# $Release Version: 0.5 $
# $Revision: 1.1.1.1.4.1 $

##
# = mathn
#
# mathn serves to make mathematical operations more precise in Ruby
# and to integrate other mathematical standard libraries.
#
# Without mathn:
#
#   3 / 2 => 1 # Integer
#
# With mathn:
#
#   3 / 2 => 3/2 # Rational
#
# mathn keeps value in exact terms.
#
# Without mathn:
#
#   20 / 9 * 3 * 14 / 7 * 3 / 2 # => 18
#
# With mathn:
#
#   20 / 9 * 3 * 14 / 7 * 3 / 2 # => 20
#
#
# When you require 'mathn', the libraries for Prime, CMath, Matrix and Vector
# are also loaded.
#
# == Copyright
#
# Author: Keiju ISHITSUKA (SHL Japan Inc.)
#--
# class Numeric follows to make this documentation findable in a reasonable
# location

warn('lib/mathn.rb is deprecated') if $VERBOSE

class Numeric; end

require "cmath.rb"
require "matrix.rb"
require "prime.rb"

require "mathn/rational"
require "mathn/complex"

unless defined?(Math.exp!)
  Object.instance_eval{remove_const :Math}
  Math = CMath # :nodoc:
end

##
# When mathn is required, Integer's division is enhanced to
# return more precise values from mathematical expressions.
#
#   2/3*3  # => 0
#   require 'mathn'
#   2/3*3  # => 2
#
#   (2**72) / ((2**70) * 3)  # => 4/3

class Integer
  remove_method :/

  ##
  # +/+ defines the Rational division for Bignum.
  #
  #   (2**72) / ((2**70) * 3)  # => 4/3

  alias / quo
end

##
# When mathn is required, the Math module changes as follows:
#
# Standard Math module behaviour:
#   Math.sqrt(4/9)     # => 0.0
#   Math.sqrt(4.0/9.0) # => 0.666666666666667
#   Math.sqrt(- 4/9)   # => Errno::EDOM: Numerical argument out of domain - sqrt
#
# After require 'mathn', this is changed to:
#
#   require 'mathn'
#   Math.sqrt(4/9)      # => 2/3
#   Math.sqrt(4.0/9.0)  # => 0.666666666666667
#   Math.sqrt(- 4/9)    # => Complex(0, 2/3)

module Math
  remove_method(:sqrt)

  ##
  # Computes the square root of +a+.  It makes use of Complex and
  # Rational to have no rounding errors if possible.
  #
  #   Math.sqrt(4/9)      # => 2/3
  #   Math.sqrt(- 4/9)    # => Complex(0, 2/3)
  #   Math.sqrt(4.0/9.0)  # => 0.666666666666667

  def sqrt(a)
    if a.kind_of?(Complex)
      sqrt!(a)
    elsif a.respond_to?(:nan?) and a.nan?
      a
    elsif a >= 0
      rsqrt(a)
    else
      Complex(0,rsqrt(-a))
    end
  end

  ##
  # Compute square root of a non negative number. This method is
  # internally used by +Math.sqrt+.

  def rsqrt(a)
    if a.kind_of?(Float)
      sqrt!(a)
    elsif a.kind_of?(Rational)
      rsqrt(a.numerator)/rsqrt(a.denominator)
    else
      src = a
      max = 2 ** 32
      byte_a = [src & 0xffffffff]
      # ruby's bug
      while (src >= max) and (src >>= 32)
        byte_a.unshift src & 0xffffffff
      end

      answer = 0
      main = 0
      side = 0
      for elm in byte_a
        main = (main << 32) + elm
        side <<= 16
        if answer != 0
          if main * 4  < side * side
            applo = main.div(side)
          else
            applo = ((sqrt!(side * side + 4 * main) - side)/2.0).to_i + 1
          end
        else
          applo = sqrt!(main).to_i + 1
        end

        while (x = (side + applo) * applo) > main
          applo -= 1
        end
        main -= x
        answer = (answer << 16) + applo
        side += applo * 2
      end
      if main == 0
        answer
      else
        sqrt!(a)
      end
    end
  end

  class << self
    remove_method(:sqrt)
  end
  module_function :sqrt
  module_function :rsqrt
end

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 03 2024 22:47:57
root / root
0755
cgi
--
March 03 2024 22:47:57
root / linksafe
0755
digest
--
March 03 2024 22:47:57
root / linksafe
0755
drb
--
March 03 2024 22:47:57
root / linksafe
0755
fiddle
--
March 03 2024 22:47:57
root / linksafe
0755
forwardable
--
March 03 2024 22:47:57
root / root
0755
io
--
March 03 2024 22:47:59
root / linksafe
0755
irb
--
March 03 2024 22:47:57
root / linksafe
0755
json
--
March 03 2024 22:47:59
root / linksafe
0755
matrix
--
March 03 2024 22:47:57
root / linksafe
0755
net
--
March 03 2024 22:47:57
root / linksafe
0755
openssl
--
March 03 2024 22:47:57
root / linksafe
0755
optparse
--
March 03 2024 22:47:57
root / linksafe
0755
psych
--
March 03 2024 22:48:00
root / linksafe
0755
racc
--
March 03 2024 22:47:57
root / linksafe
0755
rbconfig
--
March 03 2024 22:48:02
root / linksafe
0755
rdoc
--
March 03 2024 22:48:01
root / linksafe
0755
rexml
--
March 03 2024 22:47:57
root / linksafe
0755
rinda
--
March 03 2024 22:47:57
root / linksafe
0755
ripper
--
March 03 2024 22:47:57
root / linksafe
0755
rss
--
March 03 2024 22:47:57
root / linksafe
0755
rubygems
--
March 03 2024 22:48:02
root / linksafe
0755
shell
--
March 03 2024 22:47:57
root / linksafe
0755
syslog
--
March 03 2024 22:47:57
root / root
0755
unicode_normalize
--
March 03 2024 22:47:57
root / root
0755
uri
--
March 03 2024 22:47:57
root / linksafe
0755
webrick
--
March 03 2024 22:47:57
root / linksafe
0755
x86_64-linux
--
March 03 2024 22:48:00
root / root
0755
yaml
--
March 03 2024 22:47:57
root / linksafe
0755
English.rb
6.452 KB
March 31 2020 11:42:18
root / linksafe
0644
abbrev.rb
3.492 KB
March 31 2020 11:42:18
root / linksafe
0644
base64.rb
3.307 KB
March 31 2020 11:42:18
root / linksafe
0644
benchmark.rb
17.898 KB
March 31 2020 11:42:18
root / linksafe
0644
cgi.rb
9.804 KB
March 31 2020 11:42:18
root / linksafe
0644
cmath.rb
9.478 KB
March 31 2020 11:42:18
root / linksafe
0644
csv.rb
83.531 KB
March 31 2020 11:42:18
root / linksafe
0644
date.rb
0.98 KB
July 26 2023 14:47:32
root / linksafe
0644
debug.rb
29.976 KB
March 31 2020 11:42:18
root / linksafe
0644
delegate.rb
10.306 KB
March 31 2020 11:42:18
root / linksafe
0644
digest.rb
2.826 KB
July 26 2023 14:47:33
root / linksafe
0644
drb.rb
0.049 KB
March 31 2020 11:42:18
root / linksafe
0644
e2mmap.rb
3.944 KB
March 31 2020 11:42:18
root / linksafe
0644
erb.rb
27.246 KB
March 31 2020 11:42:18
root / linksafe
0644
expect.rb
2.174 KB
July 26 2023 14:47:48
root / linksafe
0644
fiddle.rb
1.683 KB
July 26 2023 14:47:35
root / linksafe
0644
fileutils.rb
44.056 KB
March 31 2020 11:42:18
root / linksafe
0644
find.rb
2.516 KB
March 31 2020 11:42:18
root / linksafe
0644
forwardable.rb
8.504 KB
March 31 2020 11:42:18
root / linksafe
0644
getoptlong.rb
15.409 KB
March 31 2020 11:42:18
root / linksafe
0644
ipaddr.rb
17.1 KB
March 31 2020 11:42:18
root / linksafe
0644
irb.rb
20.289 KB
March 31 2020 11:42:18
root / linksafe
0644
json.rb
1.767 KB
July 26 2023 14:47:36
root / linksafe
0644
kconv.rb
5.768 KB
July 26 2023 14:47:38
root / linksafe
0644
logger.rb
23.534 KB
March 31 2020 11:42:18
root / linksafe
0644
mathn.rb
3.424 KB
March 31 2020 11:42:18
root / linksafe
0644
matrix.rb
53.366 KB
March 31 2020 11:42:18
root / linksafe
0644
mkmf.rb
84.322 KB
July 26 2023 14:46:03
root / linksafe
0644
monitor.rb
7.02 KB
March 31 2020 11:42:18
root / linksafe
0644
mutex_m.rb
2.04 KB
March 31 2020 11:42:18
root / linksafe
0644
observer.rb
5.832 KB
March 31 2020 11:42:18
root / linksafe
0644
open-uri.rb
24.764 KB
March 31 2020 11:42:18
root / linksafe
0644
open3.rb
20.595 KB
March 31 2020 11:42:18
root / linksafe
0644
openssl.rb
0.435 KB
July 26 2023 14:47:47
root / linksafe
0644
optionparser.rb
0.058 KB
March 31 2020 11:42:18
root / linksafe
0644
optparse.rb
57.25 KB
March 31 2020 11:42:18
root / linksafe
0644
ostruct.rb
10.201 KB
March 31 2020 11:42:18
root / linksafe
0644
pathname.rb
16.078 KB
July 26 2023 14:47:47
root / linksafe
0644
pp.rb
14.431 KB
March 31 2020 11:42:18
root / linksafe
0644
prettyprint.rb
15.895 KB
March 31 2020 11:42:18
root / linksafe
0644
prime.rb
12.49 KB
March 31 2020 11:42:18
root / linksafe
0644
profile.rb
0.23 KB
March 31 2020 11:42:18
root / linksafe
0644
profiler.rb
4.539 KB
March 31 2020 11:42:18
root / linksafe
0644
pstore.rb
14.705 KB
March 31 2020 11:42:18
root / linksafe
0644
psych.rb
15.249 KB
July 26 2023 14:47:48
root / linksafe
0644
rdoc.rb
5.065 KB
March 31 2020 11:42:18
root / linksafe
0644
resolv-replace.rb
1.763 KB
March 31 2020 11:42:18
root / linksafe
0644
resolv.rb
73.479 KB
March 31 2020 11:42:18
root / linksafe
0644
ripper.rb
2.556 KB
July 26 2023 14:47:52
root / linksafe
0644
rss.rb
2.871 KB
March 31 2020 11:42:18
root / linksafe
0644
rubygems.rb
35.378 KB
March 31 2020 11:42:18
root / linksafe
0644
scanf.rb
23.558 KB
March 31 2020 11:42:18
root / linksafe
0644
securerandom.rb
7.483 KB
March 31 2020 11:42:18
root / linksafe
0644
set.rb
20.735 KB
March 31 2020 11:42:18
root / linksafe
0644
shell.rb
11.371 KB
March 31 2020 11:42:18
root / linksafe
0644
shellwords.rb
6.657 KB
March 31 2020 11:42:18
root / linksafe
0644
singleton.rb
4.056 KB
March 31 2020 11:42:18
root / linksafe
0644
socket.rb
42.99 KB
July 26 2023 14:47:56
root / linksafe
0644
sync.rb
7.295 KB
March 31 2020 11:42:18
root / linksafe
0644
tempfile.rb
10.802 KB
March 31 2020 11:42:18
root / linksafe
0644
thwait.rb
3.351 KB
March 31 2020 11:42:18
root / linksafe
0644
time.rb
22.355 KB
March 31 2020 11:42:18
root / linksafe
0644
timeout.rb
3.825 KB
March 31 2020 11:42:18
root / linksafe
0644
tmpdir.rb
4.295 KB
March 31 2020 11:42:18
root / linksafe
0644
tracer.rb
6.44 KB
March 31 2020 11:42:18
root / linksafe
0644
tsort.rb
14.299 KB
March 31 2020 11:42:18
root / linksafe
0644
ubygems.rb
0.291 KB
March 31 2020 11:42:18
root / linksafe
0644
un.rb
9.176 KB
March 31 2020 11:42:18
root / linksafe
0644
unicode_normalize.rb
3.196 KB
March 31 2020 11:42:18
root / linksafe
0644
uri.rb
3.1 KB
March 31 2020 11:42:18
root / linksafe
0644
weakref.rb
2.946 KB
March 31 2020 11:42:18
root / linksafe
0644
webrick.rb
6.72 KB
March 31 2020 11:42:18
root / linksafe
0644
yaml.rb
1.73 KB
March 31 2020 11:42:18
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF