view src/build-msvctools/math/nextafterf.c @ 5893:53a6c7df43f8

Mesa 3D: Update to version 21.1.8. * src/mesa.mk: Update version and checksum. * src/mesa-2-uninitialized.patch: Remove file. * dist-files.mk: Remove file from list.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 16 Sep 2021 22:37:45 +0200
parents f8299bb6c872
children
line wrap: on
line source

#include <math.h>

float
nextafterf (float x, float y)
{
  union
  {
    float f;
    unsigned int i;
  } u;
  if (isnan (y) || isnan (x))
    return x + y;
  if (x == y )
     /* nextafter (0.0, -O.0) should return -0.0.  */
     return y;
  u.f = x; 
  if (x == 0.0F)
    {
      u.i = 1;
      return y > 0.0F ? u.f : -u.f;
    }
  if (((x > 0.0F) ^ (y > x)) == 0)
    u.i++;
  else
    u.i--;
  return u.f;
}