### Question:
DoubleOperators { @ScalarOperator(CAST) @LiteralParameters("x") @SqlType("varchar(x)") public static Slice castToVarchar(@SqlType(StandardTypes.DOUBLE) double value) { return utf8Slice(String.valueOf(value)); } private  DoubleOperators(); @ScalarOperator(ADD) @SqlType(StandardTypes.DOUBLE) static double add(@SqlType(StandardTypes.DOUBLE) double left, @SqlType(StandardTypes.DOUBLE) double right); @ScalarOperator(SUBTRACT) @SqlType(StandardTypes.DOUBLE) static double subtract(@SqlType(StandardTypes.DOUBLE) double left, @SqlType(StandardTypes.DOUBLE) double right); @ScalarOperator(MULTIPLY) @SqlType(StandardTypes.DOUBLE) static double multiply(@SqlType(StandardTypes.DOUBLE) double left, @SqlType(StandardTypes.DOUBLE) double right); @ScalarOperator(DIVIDE) @SqlType(StandardTypes.DOUBLE) static double divide(@SqlType(StandardTypes.DOUBLE) double left, @SqlType(StandardTypes.DOUBLE) double right); @ScalarOperator(MODULUS) @SqlType(StandardTypes.DOUBLE) static double modulus(@SqlType(StandardTypes.DOUBLE) double left, @SqlType(StandardTypes.DOUBLE) double right); @ScalarOperator(NEGATION) @SqlType(StandardTypes.DOUBLE) static double negate(@SqlType(StandardTypes.DOUBLE) double value); @ScalarOperator(CAST) @SqlType(StandardTypes.BOOLEAN) static boolean castToBoolean(@SqlType(StandardTypes.DOUBLE) double value); @ScalarOperator(CAST) @SqlType(StandardTypes.INTEGER) static long castToInteger(@SqlType(StandardTypes.DOUBLE) double value); @ScalarOperator(CAST) @SqlType(StandardTypes.SMALLINT) static long castToSmallint(@SqlType(StandardTypes.DOUBLE) double value); @ScalarOperator(CAST) @SqlType(StandardTypes.TINYINT) static long castToTinyint(@SqlType(StandardTypes.DOUBLE) double value); @ScalarOperator(CAST) @SqlType(StandardTypes.BIGINT) static long castToLong(@SqlType(StandardTypes.DOUBLE) double value); @ScalarOperator(CAST) @SqlType(StandardTypes.REAL) static long castToReal(@SqlType(StandardTypes.DOUBLE) double value); @ScalarOperator(CAST) @LiteralParameters("x") @SqlType("varchar(x)") static Slice castToVarchar(@SqlType(StandardTypes.DOUBLE) double value); @ScalarOperator(SATURATED_FLOOR_CAST) @SqlType(StandardTypes.REAL) static strictfp long saturatedFloorCastToFloat(@SqlType(StandardTypes.DOUBLE) double value); @ScalarOperator(SATURATED_FLOOR_CAST) @SqlType(StandardTypes.INTEGER) static long saturatedFloorCastToInteger(@SqlType(StandardTypes.DOUBLE) double value); @ScalarOperator(SATURATED_FLOOR_CAST) @SqlType(StandardTypes.SMALLINT) static long saturatedFloorCastToSmallint(@SqlType(StandardTypes.DOUBLE) double value); @ScalarOperator(SATURATED_FLOOR_CAST) @SqlType(StandardTypes.TINYINT) static long saturatedFloorCastToTinyint(@SqlType(StandardTypes.DOUBLE) double value);  }### Answer:
@Test public void testCastToVarchar() { assertFunction("cast(37.7E0 as varchar)", VARCHAR, "37.7"); assertFunction("cast(17.1E0 as varchar)", VARCHAR, "17.1"); assertFunction("cast(0E0/0E0 as varchar)", VARCHAR, "NaN"); }