• Andreas Haas's avatar
    Add a not-NaN DCHECK to the Float32 constructor · e605a14e
    Andreas Haas authored
    The class Float32 stores the bit pattern of a float as uint32_t to
    guarantee that the exact bit pattern of the contained value is
    preserved. This is necessary because the bit pattern of a NaN may
    change, e.g. when it is passed as a parameter.
    
    For convenience the Float32 class provides a constructor with a float
    parameter. Since this constructor cannot guarantee that the right bit
    pattern will be stored for NaNs, this CL adds a DCHECK now to make
    sure that the constructor is never used with a NaN.
    
    R=mstarzinger@chromium.org
    
    Change-Id: Iba85a5a1bb2778d5f8bdc1aad97524ef8369b73d
    Reviewed-on: https://chromium-review.googlesource.com/579367
    Commit-Queue: Andreas Haas <ahaas@chromium.org>
    Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#46811}
    e605a14e
boxed-float.h 2.01 KB