Jackson seems to be coercing all floats into doubles in any data structure that I am trying to serialize into JSON. Is there any way to avoid this behavior?
Float f = 50.1f;
System.out.println(f); // 50.1
System.out.println(f.doubleValue()); // 50.099998474121094
System.out.println(new ObjectMapper().valueToTree(f)); // 50.099998474121094 -- how to prevent this?
Using jackson-all-1.9.11.jar.