Ignore:
Timestamp:
Jan 21, 2018, 12:10:09 AM (6 years ago)
Author:
coas-nagasima
Message:

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

Location:
EcnlProtoTool/trunk/mruby-1.3.0
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/mruby-1.3.0/mrblib/numeric.rb

    r321 r331  
    101101  # incremented by +step+ (default 1).
    102102  #
    103   def step(num, step = 1, &block)
     103  def step(num=nil, step=1, &block)
    104104    raise ArgumentError, "step can't be 0" if step == 0
    105105    return to_enum(:step, num, step) unless block_given?
    106106
    107107    i = if num.kind_of? Float then self.to_f else self end
     108    if num == nil
     109      while true
     110        block.call(i)
     111        i+=step
     112      end
     113      return self
     114    end
    108115    if step > 0
    109116      while i <= num
     
    161168# ISO 15.2.9
    162169class Float
    163   include Integral
    164170  # mruby special - since mruby integers may be upgraded to floats,
    165171  # floats should be compatible to integers.
    166   def >> other
    167     n = self.to_i
    168     other = other.to_i
    169     if other < 0
    170       n << -other
    171     else
    172       other.times { n /= 2 }
    173       if n.abs < 1
    174         if n >= 0
    175           0
    176         else
    177           -1
    178         end
    179       else
    180         n.to_i
    181       end
    182     end
    183   end
    184   def << other
    185     n = self.to_i
    186     other = other.to_i
    187     if other < 0
    188       n >> -other
    189     else
    190       other.times { n *= 2 }
    191       n
    192     end
    193   end
     172  include Integral
    194173end
Note: See TracChangeset for help on using the changeset viewer.