[all-commits] [llvm/llvm-project] 962877: [libc++][math] Fix undue overflowing of `std::hypo...

PaulXiCao via All-commits all-commits at lists.llvm.org
Tue Jul 23 08:12:05 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9628777479a970db5d0c2d0b456dac6633864760
      https://github.com/llvm/llvm-project/commit/9628777479a970db5d0c2d0b456dac6633864760
  Author: PaulXiCao <paulxicao7 at gmail.com>
  Date:   2024-07-23 (Tue, 23 Jul 2024)

  Changed paths:
    M libcxx/include/__math/hypot.h
    M libcxx/include/cmath
    M libcxx/test/libcxx/transitive_includes/cxx17.csv
    M libcxx/test/libcxx/transitive_includes/cxx20.csv
    M libcxx/test/libcxx/transitive_includes/cxx23.csv
    M libcxx/test/libcxx/transitive_includes/cxx26.csv
    M libcxx/test/std/numerics/c.math/cmath.pass.cpp
    M libcxx/test/support/fp_compare.h

  Log Message:
  -----------
  [libc++][math] Fix undue overflowing of `std::hypot(x,y,z)` (#93350)

The 3-dimentionsional `std::hypot(x,y,z)` was sub-optimally implemented.
This lead to possible over-/underflows in (intermediate) results which
can be circumvented by this proposed change.

The idea is to to scale the arguments (see linked issue for full
discussion).

Tests have been added for problematic over- and underflows.

Closes #92782



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list