Returns the value unless it is NaN, in which case returns the replacement. Returns a float if the value is a float and the replacement is a float or null, and a double otherwise.
式のカテゴリー: 数値
引数
Expression: Number to return unless it is NaN. Expression<Numeric>
Replacement: Number to return when the value is NaN. Expression<Numeric>
出力タイプ:Double | Float
例
例1:基本ケース
引数の値:
Expression:value
Replacement:replacement
value
replacement
出力
1.5
0.0
1.5
NaN
0.0
0.0
例2:基本ケース
説明: Returns a float if both numbers are floats.
引数の値:
Expression:value
Replacement:replacement
value
replacement
出力
2.5
1.0
2.5
-0.0
1.0
-0.0
例3:Null ケース
説明: Returns null if the value is null, or if it is NaN and the replacement is null.