Fix type of exact? and inexact?.

Closes PR12900.