HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.2.10/ext/-test-/float/nextafter.c
#include "ruby.h"

static VALUE
system_nextafter_m(VALUE klass, VALUE vx, VALUE vy)
{
    double x, y, z;

    x = NUM2DBL(vx);
    y = NUM2DBL(vy);
    z = nextafter(x, y);

    return DBL2NUM(z);
}

#define nextafter missing_nextafter
#include "../../../missing/nextafter.c"
#undef nextafter

static VALUE
missing_nextafter_m(VALUE klass, VALUE vx, VALUE vy)
{
    double x, y, z;

    x = NUM2DBL(vx);
    y = NUM2DBL(vy);
    z = missing_nextafter(x, y);

    return DBL2NUM(z);
}

void
Init_nextafter(VALUE klass)
{
    rb_define_singleton_method(klass, "system_nextafter", system_nextafter_m, 2);
    rb_define_singleton_method(klass, "missing_nextafter", missing_nextafter_m, 2);
}