-- by int -- int by int SELECT is_jsonb_valid('{"multipleOf":2}', '10'); is_jsonb_valid ---------------- t (1 row) -- int by int fail SELECT is_jsonb_valid('{"multipleOf":2}', '7'); is_jsonb_valid ---------------- f (1 row) -- ignores non-numbers SELECT is_jsonb_valid('{"multipleOf":2}', '"foo"'); is_jsonb_valid ---------------- t (1 row) -- by number -- zero is multiple of anything SELECT is_jsonb_valid('{"multipleOf":1.5}', '0'); is_jsonb_valid ---------------- t (1 row) -- 4.5 is multiple of 1.5 SELECT is_jsonb_valid('{"multipleOf":1.5}', '4.5'); is_jsonb_valid ---------------- t (1 row) -- 35 is not multiple of 1.5 SELECT is_jsonb_valid('{"multipleOf":1.5}', '35'); is_jsonb_valid ---------------- f (1 row) -- by small number -- 0.0075 is multiple of 0.0001 SELECT is_jsonb_valid('{"multipleOf":0.0001}', '0.0075'); is_jsonb_valid ---------------- t (1 row) -- 0.00751 is not multiple of 0.0001 SELECT is_jsonb_valid('{"multipleOf":0.0001}', '0.00751'); is_jsonb_valid ---------------- f (1 row)