Skip to content

[libc][math] ensure math functions have tests for proper exception, errno, and special case handling #88819

Open
@Flandini

Description

@Flandini

This is in response to #61092.

We should make sure we have tests for all the special cases for all math functions. Tests should use the newly added FPMatchers in libc/test/UnitTest/FPMatcher.h after #88816.

I think many of these are fine, but some like the nearest integer functions will need to have their tests broken up or have conditional handling added to the test (e.g., lrint vs lround).

There are a lot of these, maybe we could good-first-issue this issue and assign someone to each function?

  • ceil
  • canonicalize
  • copysign
  • dadd
  • ddiv
  • dfma
  • dmul
  • dsub
  • fabs
  • fadd
  • fdim
  • fdiv
  • ffma
  • floor
  • fmax
  • fmaximum
  • fmaximum_mag
  • fmaximum_mag_num
  • fmaximum_num
  • fmin
  • fminimum
  • fminimum_mag
  • fminimum_mag_num
  • fminimum_num
  • fmod
  • fmul
  • frexp
  • fromfp
  • fromfpx
  • fsub
  • ilogb
  • ldexp
  • llrint
  • llround
  • logb - I'm working on this one
  • lrint
  • lround
  • modf
  • nan
  • nearbyint
  • nextafter - I'm working on this one
  • nextdown
  • nexttoward
  • nextup
  • remainder - I'm working on this one
  • remquo - I'm working on this one
  • rint
  • round
  • roundeven
  • scalbn
  • trunc
  • ufromfp
  • ufromfpx
  • acos
  • acosh
  • acospi
  • asin
  • asinh
  • asinpi
  • atan
  • atan2
  • atan2pi
  • atanh
  • atanpi
  • cbrt
  • compoundn
  • cos
  • cosh
  • cospi
  • dsqrt
  • erf
  • erfc
  • exp
  • exp10
  • exp10m1
  • exp2
  • exp2m1
  • expm1
  • fma - I'm working on this one
  • fsqrt
  • hypot
  • lgamma
  • log - I'm working on this one
  • log10
  • log10p1
  • log1p
  • log2
  • log2p1
  • logp1
  • pow
  • pown
  • powr
  • rootn
  • rsqrt
  • sin
  • sincos
  • sinh
  • sinpi
  • sqrt - I'm working on this one
  • tan
  • tanh
  • tanpi
  • tgamma

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions