[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dennou-ruby:003726] Re: numru-units on ruby 2.1



ããããã

æäãããåãããããååãèãããããããããæããäãåäãããããããåäããããããæååèçãååããïãããåèããïãèããããããããããããã == ã assert ãããããããããããã

ãããããããïããããããããããã == æçåãéèããããããããããããããïæåãããæåããæãããããäååäããããããäèãåæããããããçããããããããéãããçæãããããããããã


Best Regards,
--
Eiji (aka Eizi) TOYODA
http://www.google.com/profiles/toyoda.eizi | twitter:e_toyoda | toyoda at npd.kishou.go.jp


2014-04-28 9:41 GMT+09:00 Takeshi Horinouchi <horinout@xxxxxxxxxxxxxxxxx>:
æäãã

ããããéãåéããããïåãåäãèèããããããããããã
ïæäããèèãæãããããããããããããããããï
èçããããåãããåéãææçããããïãããèæ
ãããã GPhys ãåäãããããäæãææãåéã
ãããããããããåéãããçãããããããããããããã

ï 1.6 ãã 1.8 ããäæåæãååãããããã...
 Â(ãæåãããïéåããããããååãåãããããã
 Âãããããã)

> èçãããåäåããã
>
> æäçäããã
>
> ããããããruby 1.9.3, 2.0.0 ããããããéããããã
> ääãããããããããããããããæãæãããåãéããããã
> ----ãããã----
> $ diff -u numru-units-1.7/src/test.rb numru-units/src/test.rb
> --- numru-units-1.7/src/test.rb       2004-03-01 13:45:28.000000000 +0900
> +++ numru-units/src/test.rb     2014-04-28 00:44:06.880925724 +0900
> @@ -8,7 +8,7 @@
>
> Âputs "=== reduce1 ==="
>
> -assert Units.new('').reduce1.to_s, ""
> +assert Units.new('').reduce1.to_s, "1"
> Âassert Units.new('m').reduce1.to_s, "m"
> Âassert Units.new('3').reduce1.to_s, "3"
> Âassert Units.new('3.14').reduce1.to_s, "3.14"
> @@ -75,18 +75,18 @@
> Âassert Units.new('km2').reduce4.to_s, "km2"
> Âassert Units.new('hours.hour').reduce4.to_s, "hour2"
> Âassert Units.new('(10)^2').reduce4.to_s, "100"
> -assert Units.new('100/10').reduce4.to_s, "10.0"
> -assert Units.new('(10)^2/100').reduce4.to_s, "1.0"
> +assert Units.new('100/10').reduce4.to_s, "10"
> +assert Units.new('(10)^2/100').reduce4.to_s, "1"
>
> Âputs "=== reduce5 ==="
>
> Âassert Units.new('km2').reduce5.to_s, "1000000 m2"
> -assert Units.new('(10)^2/100').reduce5.to_s, "1.0"
> +assert Units.new('(10)^2/100').reduce5.to_s, "1"
>
> Âassert Units.new('hPa').reduce5.to_s, "100 kg.m-1 s-2"
> -assert Units.new('mb').reduce5.to_s, "100.0 kg.m-1 s-2"
> +assert Units.new('mb').reduce5.to_s, "100 kg.m-1 s-2"
>
> -assert Units.new('hPa/mb').reduce5.to_s, "1.0"
> +assert Units.new('hPa/mb').reduce5.to_s, "1"
>
> Âassert Units.new('(K @ 273.15)@ 10').reduce5.to_s, "(K @ 283.15)"
>
> ----ãããã----
>
> $ ruby19 /home/murashin/software/lib/ruby/site_ruby/1.9.1/numru/units.rb
> äç
> === APPLICATIONS ===
> ok 4900
> /home/murashin/software/lib/ruby/site_ruby/1.9.1/numru/units.rb:3387:in `assert': "273.15000000000003" != "273.15" (RuntimeError)
> from /home/murashin/software/lib/ruby/site_ruby/1.9.1/numru/units.rb:3478:in `<main>'
> ããããããããã
> # æååæçæãåãããããéããããã...?(1.8.7ããéã(ããã?))
>
> From: Eizi TOYODA <toyoda.eizi@xxxxxxxxx>
> Date: Mon, 28 Apr 2014 00:20:18 +0900
>
> > æäãã
> >
> > äåãããããæãäããããã
> > ããããèããããèããã ãããRuby 2.1 ããããããããäããçåããããããããæçãããããããã
> >
> > èçæ
> >
> > from android phone
> > 2014/04/27 20:52 "Shin-ya Murakami" <murashin@xxxxxxxxxxxxxx>:
> >
> >> åäåãããèçããã
> >>
> >> æäçäããã
> >>
> >> # æããããããããããããèçãããToãåããããããã
> >>
> >> çãèãããããããããåããããããããã
> >>
> >> ãããã(ããããæé)ãhttp://ruby.gfd-dennou.org/ml/index-j.htm
> >> ã2014åãããããããããããããçãrubyãããããåãããããã
> >> çéããããããããããããããããéãèãããã
> >>
> >> From: Takeshi Horinouchi <horinout@xxxxxxxxxxxxxxxxx>
> >> Date: Thu, 10 Apr 2014 11:12:33 +0900
> >>
> >> > åäåããã
> >> >
> >> > ãããã Ruby 2.1 ããåäããããã numru-units ããããåããã
> >> > ããããïåæã "1" ÂåéããåïãRacc ããããèãããããã
> >> > ãããïèæãéèããããããããããèåããããåãããããã...
> >> > ï èçããïæéåãããããããã
> >> >
> >> > ãèãçãéè K ãçãããããä
> >> > (/home/horinout/tmp/ruby2.1/bin/ïã ruby 2.1.1 ããããããã
> >> > ãããããããã (nurmu-unitsãgemããããããïïãããããã
> >> > ããæãèããããããããã
> >> >
> >> > ääåèäããã
> >> >
> >> > â ruby 2.0 ããïåéããïï
> >> >
> >> > $ ruby --version
> >> > ruby 2.0.0p451 (2014-02-24 revision 45167) [i686-linux]
> >> > $ ruby -r numru/units -e "u=NumRu::Units['m/s']; u2=NumRu::Units['s'];
> >> puts u*u2"
> >> > m
> >> >
> >> > â ruby 2.0 ããïåéããïï
> >> >
> >> > $ use_ruby 2.1
> >> > ruby 2.1.1p76 (2014-02-24 revision 45161) [i686-linux]
> >> > $ ruby -r numru/units -e "u=NumRu::Units['m/s'];
> >> > u2=NumRu::Units['s']; puts u*u2"
> >> > /opt/ruby2.1/lib/ruby/site_ruby/2.1.0/numru/units.rb:209:in
> >> `foldnumber': undefined method `foldnumber' for
> >> Error[m/s]:NumRu::Units::ErrorNode (NoMethodError)
> >> > Â Â Â from /opt/ruby2.1/lib/ruby/site_ruby/2.1.0/numru/units.rb:139:in
> >> `reduce4'
> >> > Â Â Â from /opt/ruby2.1/lib/ruby/site_ruby/2.1.0/numru/units.rb:2611:in
> >> `binop'
> >> > Â Â Â from /opt/ruby2.1/lib/ruby/site_ruby/2.1.0/numru/units.rb:2616:in
> >> `*'
> >> > Â Â Â from -e:1:in `<main>'
> >> >
> >> > ãããããæçããããèããããããããããããããããããã
> >> > ããããï
> >> >
> >> > $ ruby -r numru/units -e "u=NumRu::Units['m']; p u.do_parse2,
> >> > u.do_parse2.class"
> >> > Error[m]
> >> > NumRu::Units::ErrorNode
> >> >
> >> > ãããïdo_parse2 ããããã Racc ãæãã parse åçã
> >> > çæã nil ããã ErrorNode ãããããèãããããããã
> >> > åéãããããããã parse ããããããããããããããã...ã
> >> >
> >> > åäå æ
> >> ----
> >> Shin-ya Murakami
> >> email: murashin@xxxxxxxxxxxxxx
> >> WWW: http://www.gfd-dennou.org/member/murashin/
> ----
> Shin-ya Murakami
> email: murashin@xxxxxxxxxxxxxx
> WWW: http://www.gfd-dennou.org/member/murashin/
>

åäå æ
åæéåå åççåçåççé åçåçåéé
ã060-0810 æååååå10æè5äç