コガネブログ
id:baba_s
【C#】浮動小数点以下の数値が存在する場合 true を返す拡張メソッド
ソースコード public static class FloatExt { public static bool IsExistAfterDecimalPoint( this float self ) { return self % 1 != 0; } } 使い方 Debug.Log( 1f.IsExistAfterDecimalPoint() ); // False Debug.Log( 1.23f.IsExistAfterDecimalPoint() ); // True 関連記事