public SoyExpression coerceToDouble ( ) { if ( ! isBoxed ( ) ) { if ( soyRuntimeType . isKnownFloat ( ) ) { return this ; } if ( soyRuntimeType . isKnownInt ( ) ) { return forFloat ( BytecodeUtils . numericConversion ( delegate , Type . DOUBLE_TYPE ) ) ; } throw new UnsupportedOperationException ( "Can't convert " + resultType ( ) + " to a double" ) ; } if ( soyRuntimeType . isKnownFloat ( ) ) { return forFloat ( delegate . invoke ( MethodRef . SOY_VALUE_FLOAT_VALUE ) ) ; } return forFloat ( delegate . invoke ( MethodRef . SOY_VALUE_NUMBER_VALUE ) ) ; }
Coerce this expression to a double value . Useful for float - int comparisons .