• Yedidya Feldblum's avatar
    constexpr_abs · cf93e807
    Yedidya Feldblum authored
    Summary:
    [Folly] `constexpr_abs`.
    
    Is `constexpr`.
    
    Works over integral and floating types.
    
    If given an integral type, the return type is the usigned version of that integral type, thereby avoiding the undefined behavior of `std::abs(std::numeric_limits<int>::min())`.
    
    Reviewed By: simpkins
    
    Differential Revision: D3654072
    
    fbshipit-source-id: 24fefc0c3b055f78ba3e07472c38fb9c550e0f31
    cf93e807
Constexpr.h 2.38 KB