大きな桁ってか桁を退避してるだけですが^^;
またしても単体テストすらしてないw
単体テストで気合ってw
#module m_plus_double member_dbl_value,member_after_mul,member_after_div #modinit member_dbl_value=0.0 member_after_mul=0 member_after_div=0 return #modfunc local dump logmes "value:"+str(member_dbl_value) logmes "after_mul:"+str(member_after_mul) logmes "after_div:"+str(member_after_div) return #modfunc local set_member_dbl_value double _p_dbl member_dbl_value=_p_dbl return #modfunc local set_member_after_mul int _p_int member_after_mul=_p_int return #modfunc local set_member_after_div int _p_int member_after_div=_p_int return #modcfunc local get_member_dbl_value return member_dbl_value #modcfunc local get_member_after_mul return member_after_mul #modcfunc local get_member_after_div return member_after_div #modfunc local mul_after_mul int p_places,local loc_tmp // places:桁 loc_tmp=1.0 repeat p_places loc_tmp*=10.0 loop member_dbl_value/=loc_tmp member_after_mul+=p_places return #modfunc local div_after_mul int p_places,local loc_tmp loc_tmp=1.0 repeat p_places loc_tmp*=10.0 loop member_dbl_value*=loc_tmp member_after_mul-=p_places return #modfunc local div_after_div int p_places,local loc_tmp loc_tmp=1.0 repeat p_places loc_tmp*=10.0 loop member_dbl_value*=loc_tmp member_after_div+=p_places return #modfunc local mul_after_div int p_places,local loc_tmp loc_tmp=1.0 repeat p_places loc_tmp*=10.0 loop member_dbl_value/=loc_tmp member_after_div-=p_places return #global newmod obj_setter,m_plus_double logmes "++setter" set_member_dbl_value@m_plus_double obj_setter,123.45 set_member_after_mul@m_plus_double obj_setter,14 set_member_after_div@m_plus_double obj_setter,23.5//int に変換されるはず dump@m_plus_double obj_setter logmes "++getter" logmes "get dbl_value:"+str(get_member_dbl_value@m_plus_double(obj_setter)) logmes "get after_mul:"+str(get_member_after_mul@m_plus_double(obj_setter)) logmes "get after_div:"+str(get_member_after_div@m_plus_double(obj_setter)) newmod obj_tmp,m_plus_double logmes "++001" set_member_dbl_value@m_plus_double obj_tmp,567.89 set_member_after_mul@m_plus_double obj_tmp,0 set_member_after_div@m_plus_double obj_tmp,0 dump@m_plus_double obj_tmp logmes "++002" mul_after_mul@m_plus_double obj_tmp,2 dump@m_plus_double obj_tmp logmes "++003" mul_after_mul@m_plus_double obj_tmp,0 dump@m_plus_double obj_tmp logmes "++004" div_after_mul@m_plus_double obj_tmp,3 dump@m_plus_double obj_tmp newmod obj_tmp_2nd,m_plus_double logmes "++005" set_member_dbl_value@m_plus_double obj_tmp_2nd,4321.09 set_member_after_mul@m_plus_double obj_tmp_2nd,0 set_member_after_div@m_plus_double obj_tmp_2nd,0 dump@m_plus_double obj_tmp_2nd logmes "++006" div_after_div@m_plus_double obj_tmp_2nd,3 dump@m_plus_double obj_tmp_2nd logmes "++007" div_after_div@m_plus_double obj_tmp_2nd,0 dump@m_plus_double obj_tmp_2nd logmes "++008" mul_after_div@m_plus_double obj_tmp_2nd,1 dump@m_plus_double obj_tmp_2nd