From 8a87549315d0c7fd984a8ad239ebe3dbab4d2855 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 14 Aug 2020 14:34:53 +0900 Subject: Rename float configuration option names. - `MRB_WITHOUT_FLOAT` => `MRB_NO_FLOAT` - `MRB_USE_FLOAT` => `MRB_USE_FLOAT32` The former is to use `USE_XXX` naming convention. The latter is to make sure `float` is 32bit float and not floating point number in general. --- mrbgems/mruby-complex/src/complex.c | 8 ++++---- mrbgems/mruby-complex/test/complex.rb | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'mrbgems/mruby-complex') diff --git a/mrbgems/mruby-complex/src/complex.c b/mrbgems/mruby-complex/src/complex.c index 24dad4235..85735b704 100644 --- a/mrbgems/mruby-complex/src/complex.c +++ b/mrbgems/mruby-complex/src/complex.c @@ -3,8 +3,8 @@ #include #include -#ifdef MRB_WITHOUT_FLOAT -# error Complex conflicts 'MRB_WITHOUT_FLOAT' configuration in your 'build_config.rb' +#ifdef MRB_NO_FLOAT +# error Complex conflicts with 'MRB_NO_FLOAT' configuration #endif struct mrb_complex { @@ -12,13 +12,13 @@ struct mrb_complex { mrb_float imaginary; }; -#ifdef MRB_USE_FLOAT +#ifdef MRB_USE_FLOAT32 #define F(x) x##f #else #define F(x) x #endif -#if defined(MRB_64BIT) || defined(MRB_USE_FLOAT) +#if defined(MRB_64BIT) || defined(MRB_USE_FLOAT32) #define COMPLEX_USE_ISTRUCT /* use TT_ISTRUCT */ diff --git a/mrbgems/mruby-complex/test/complex.rb b/mrbgems/mruby-complex/test/complex.rb index d996e8277..14711ad73 100644 --- a/mrbgems/mruby-complex/test/complex.rb +++ b/mrbgems/mruby-complex/test/complex.rb @@ -60,7 +60,7 @@ assert 'Complex#/' do assert_complex Complex(9, 8) / 4 , ((9 / 4) + 2i) assert_complex Complex(20, 9) / 9.8 , (2.0408163265306123 + 0.9183673469387754i) if 1e39.infinite? then - # MRB_USE_FLOAT in effect + # MRB_USE_FLOAT32 in effect ten = 1e21 one = 1e20 else @@ -80,7 +80,7 @@ assert 'Complex#abs' do assert_float Complex(-1).abs, 1 assert_float Complex(3.0, -4.0).abs, 5.0 if 1e39.infinite? then - # MRB_USE_FLOAT in effect + # MRB_USE_FLOAT32 in effect exp = 125 else exp = 1021 -- cgit v1.2.3