Module: MPFI::Math
- Defined in:
- ext/mpfi/ruby_mpfi.c
Class Method Summary collapse
-
.acos ⇒ Object
mpfi_acos(ret, p1).
-
.acosh ⇒ Object
mpfi_acosh(ret, p1).
-
.add ⇒ Object
Addition.
-
.asin ⇒ Object
mpfi_asin(ret, p1).
-
.asinh ⇒ Object
mpfi_asinh(ret, p1).
-
.atan ⇒ Object
mpfi_atan(ret, p1).
-
.atanh ⇒ Object
mpfi_atanh(ret, p1).
-
.const_euler ⇒ Object
mpfi_const_euler(ret).
-
.const_log2 ⇒ Object
mpfi_const_log2(ret).
-
.const_pi ⇒ Object
mpfi_const_pi(ret).
-
.cos ⇒ Object
mpfi_cos(ret, p1).
-
.cosh ⇒ Object
mpfi_cosh(ret, p1).
-
.div ⇒ Object
Division.
-
.exp ⇒ Object
mpfi_exp(ret, p1).
-
.exp2 ⇒ Object
mpfi_exp2(ret, p1).
-
.expm1 ⇒ Object
mpfi_expm1(ret, p1).
-
.log ⇒ Object
mpfi_log(ret, p1).
-
.log10 ⇒ Object
mpfi_log10(ret, p1).
-
.log1p ⇒ Object
mpfi_log1p(ret, p1).
-
.log2 ⇒ Object
mpfi_log2(ret, p1).
-
.mul ⇒ Object
Multiplication.
-
.sin ⇒ Object
mpfi_sin(ret, p1).
-
.sinh ⇒ Object
mpfi_sinh(ret, p1).
-
.sqr ⇒ Object
mpfi_sqr(ret, p1).
-
.sqrt ⇒ Object
mpfi_sqrt(ret, p1).
-
.sub ⇒ Object
Subtraction.
-
.tan ⇒ Object
mpfi_tan(ret, p1).
-
.tanh ⇒ Object
mpfi_tanh(ret, p1).
Class Method Details
.acos ⇒ Object
mpfi_acos(ret, p1)
1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 |
# File 'ext/mpfi/ruby_mpfi.c', line 1393
static VALUE r_mpfi_math_acos (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_acos(ptr_ret, ptr_a0));
return val_ret;
}
|
.acosh ⇒ Object
mpfi_acosh(ret, p1)
1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 |
# File 'ext/mpfi/ruby_mpfi.c', line 1465
static VALUE r_mpfi_math_acosh (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_acosh(ptr_ret, ptr_a0));
return val_ret;
}
|
.add ⇒ Object
Addition.
1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 |
# File 'ext/mpfi/ruby_mpfi.c', line 1173
static VALUE r_mpfi_math_add (int argc, VALUE *argv, VALUE self)
{
VALUE val_ret;
MPFI *ptr_a0, *ptr_ret;
volatile VALUE tmp_argv0;
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(2, 3, argc, argv));
tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
if (RTEST(rb_funcall(__mpfi_class__, eqq, 1, argv[1]))) {
MPFI *ptr_other;
r_mpfi_get_struct(ptr_other, argv[1]);
r_mpfi_set_function_state(mpfi_add(ptr_ret, ptr_a0, ptr_other));
} else if (RTEST(rb_funcall(__mpfr_class__, eqq, 1, argv[1]))) {
MPFR *ptr_other;
r_mpfr_get_struct(ptr_other, argv[1]);
r_mpfi_set_function_state(mpfi_add_fr(ptr_ret, ptr_a0, ptr_other));
} else if (TYPE(argv[1]) == T_FIXNUM) {
r_mpfi_set_function_state(mpfi_add_si(ptr_ret, ptr_a0, FIX2LONG(argv[1])));
} else if (TYPE(argv[1]) == T_FLOAT) {
r_mpfi_set_function_state(mpfi_add_d(ptr_ret, ptr_a0, NUM2DBL(argv[1])));
} else {
MPFI *ptr_a2;
volatile VALUE tmp_argv1 = r_mpfi_new_fi_obj(argv[1]);
r_mpfi_get_struct(ptr_a2, tmp_argv1);
r_mpfi_set_function_state(mpfi_add(ptr_ret, ptr_a0, ptr_a2));
}
return val_ret;
}
|
.asin ⇒ Object
mpfi_asin(ret, p1)
1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 |
# File 'ext/mpfi/ruby_mpfi.c', line 1405
static VALUE r_mpfi_math_asin (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_asin(ptr_ret, ptr_a0));
return val_ret;
}
|
.asinh ⇒ Object
mpfi_asinh(ret, p1)
1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 |
# File 'ext/mpfi/ruby_mpfi.c', line 1477
static VALUE r_mpfi_math_asinh (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_asinh(ptr_ret, ptr_a0));
return val_ret;
}
|
.atan ⇒ Object
mpfi_atan(ret, p1)
1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 |
# File 'ext/mpfi/ruby_mpfi.c', line 1417
static VALUE r_mpfi_math_atan (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_atan(ptr_ret, ptr_a0));
return val_ret;
}
|
.atanh ⇒ Object
mpfi_atanh(ret, p1)
1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 |
# File 'ext/mpfi/ruby_mpfi.c', line 1489
static VALUE r_mpfi_math_atanh (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_atanh(ptr_ret, ptr_a0));
return val_ret;
}
|
.const_euler ⇒ Object
mpfi_const_euler(ret)
1569 1570 1571 1572 1573 1574 1575 1576 |
# File 'ext/mpfi/ruby_mpfi.c', line 1569
static VALUE r_mpfi_math_const_euler (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_ret;
VALUE val_ret;
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(0, 1, argc, argv));
r_mpfi_set_function_state(mpfi_const_euler(ptr_ret));
return val_ret;
}
|
.const_log2 ⇒ Object
mpfi_const_log2(ret)
1549 1550 1551 1552 1553 1554 1555 1556 |
# File 'ext/mpfi/ruby_mpfi.c', line 1549
static VALUE r_mpfi_math_const_log2 (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_ret;
VALUE val_ret;
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(0, 1, argc, argv));
r_mpfi_set_function_state(mpfi_const_log2(ptr_ret));
return val_ret;
}
|
.const_pi ⇒ Object
mpfi_const_pi(ret)
1559 1560 1561 1562 1563 1564 1565 1566 |
# File 'ext/mpfi/ruby_mpfi.c', line 1559
static VALUE r_mpfi_math_const_pi (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_ret;
VALUE val_ret;
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(0, 1, argc, argv));
r_mpfi_set_function_state(mpfi_const_pi(ptr_ret));
return val_ret;
}
|
.cos ⇒ Object
mpfi_cos(ret, p1)
1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 |
# File 'ext/mpfi/ruby_mpfi.c', line 1357
static VALUE r_mpfi_math_cos (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_cos(ptr_ret, ptr_a0));
return val_ret;
}
|
.cosh ⇒ Object
mpfi_cosh(ret, p1)
1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 |
# File 'ext/mpfi/ruby_mpfi.c', line 1429
static VALUE r_mpfi_math_cosh (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_cosh(ptr_ret, ptr_a0));
return val_ret;
}
|
.div ⇒ Object
Division.
1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 |
# File 'ext/mpfi/ruby_mpfi.c', line 1263
static VALUE r_mpfi_math_div (int argc, VALUE *argv, VALUE self)
{
VALUE val_ret;
MPFI *ptr_a0, *ptr_ret;
volatile VALUE tmp_argv0;
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(2, 3, argc, argv));
tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
if (RTEST(rb_funcall(__mpfi_class__, eqq, 1, argv[1]))) {
MPFI *ptr_other;
r_mpfi_get_struct(ptr_other, argv[1]);
r_mpfi_set_function_state(mpfi_div(ptr_ret, ptr_a0, ptr_other));
} else if (RTEST(rb_funcall(__mpfr_class__, eqq, 1, argv[1]))) {
MPFR *ptr_other;
r_mpfr_get_struct(ptr_other, argv[1]);
r_mpfi_set_function_state(mpfi_div_fr(ptr_ret, ptr_a0, ptr_other));
} else if (TYPE(argv[1]) == T_FIXNUM) {
r_mpfi_set_function_state(mpfi_div_si(ptr_ret, ptr_a0, FIX2LONG(argv[1])));
} else if (TYPE(argv[1]) == T_FLOAT) {
r_mpfi_set_function_state(mpfi_div_d(ptr_ret, ptr_a0, NUM2DBL(argv[1])));
} else {
MPFI *ptr_a2;
volatile VALUE tmp_argv1 = r_mpfi_new_fi_obj(argv[1]);
r_mpfi_get_struct(ptr_a2, tmp_argv1);
r_mpfi_set_function_state(mpfi_div(ptr_ret, ptr_a0, ptr_a2));
}
return val_ret;
}
|
.exp ⇒ Object
mpfi_exp(ret, p1)
1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 |
# File 'ext/mpfi/ruby_mpfi.c', line 1333
static VALUE r_mpfi_math_exp (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_exp(ptr_ret, ptr_a0));
return val_ret;
}
|
.exp2 ⇒ Object
mpfi_exp2(ret, p1)
1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 |
# File 'ext/mpfi/ruby_mpfi.c', line 1345
static VALUE r_mpfi_math_exp2 (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_exp2(ptr_ret, ptr_a0));
return val_ret;
}
|
.expm1 ⇒ Object
mpfi_expm1(ret, p1)
1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 |
# File 'ext/mpfi/ruby_mpfi.c', line 1513
static VALUE r_mpfi_math_expm1 (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_expm1(ptr_ret, ptr_a0));
return val_ret;
}
|
.log ⇒ Object
mpfi_log(ret, p1)
1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 |
# File 'ext/mpfi/ruby_mpfi.c', line 1321
static VALUE r_mpfi_math_log (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_log(ptr_ret, ptr_a0));
return val_ret;
}
|
.log10 ⇒ Object
mpfi_log10(ret, p1)
1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 |
# File 'ext/mpfi/ruby_mpfi.c', line 1537
static VALUE r_mpfi_math_log10 (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_log10(ptr_ret, ptr_a0));
return val_ret;
}
|
.log1p ⇒ Object
mpfi_log1p(ret, p1)
1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 |
# File 'ext/mpfi/ruby_mpfi.c', line 1501
static VALUE r_mpfi_math_log1p (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_log1p(ptr_ret, ptr_a0));
return val_ret;
}
|
.log2 ⇒ Object
mpfi_log2(ret, p1)
1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 |
# File 'ext/mpfi/ruby_mpfi.c', line 1525
static VALUE r_mpfi_math_log2 (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_log2(ptr_ret, ptr_a0));
return val_ret;
}
|
.mul ⇒ Object
Multiplication.
1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 |
# File 'ext/mpfi/ruby_mpfi.c', line 1233
static VALUE r_mpfi_math_mul (int argc, VALUE *argv, VALUE self)
{
VALUE val_ret;
MPFI *ptr_a0, *ptr_ret;
volatile VALUE tmp_argv0;
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(2, 3, argc, argv));
tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
if (RTEST(rb_funcall(__mpfi_class__, eqq, 1, argv[1]))) {
MPFI *ptr_other;
r_mpfi_get_struct(ptr_other, argv[1]);
r_mpfi_set_function_state(mpfi_mul(ptr_ret, ptr_a0, ptr_other));
} else if (RTEST(rb_funcall(__mpfr_class__, eqq, 1, argv[1]))) {
MPFR *ptr_other;
r_mpfr_get_struct(ptr_other, argv[1]);
r_mpfi_set_function_state(mpfi_mul_fr(ptr_ret, ptr_a0, ptr_other));
} else if (TYPE(argv[1]) == T_FIXNUM) {
r_mpfi_set_function_state(mpfi_mul_si(ptr_ret, ptr_a0, FIX2LONG(argv[1])));
} else if (TYPE(argv[1]) == T_FLOAT) {
r_mpfi_set_function_state(mpfi_mul_d(ptr_ret, ptr_a0, NUM2DBL(argv[1])));
} else {
MPFI *ptr_a2;
volatile VALUE tmp_argv1 = r_mpfi_new_fi_obj(argv[1]);
r_mpfi_get_struct(ptr_a2, tmp_argv1);
r_mpfi_set_function_state(mpfi_mul(ptr_ret, ptr_a0, ptr_a2));
}
return val_ret;
}
|
.sin ⇒ Object
mpfi_sin(ret, p1)
1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 |
# File 'ext/mpfi/ruby_mpfi.c', line 1369
static VALUE r_mpfi_math_sin (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_sin(ptr_ret, ptr_a0));
return val_ret;
}
|
.sinh ⇒ Object
mpfi_sinh(ret, p1)
1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 |
# File 'ext/mpfi/ruby_mpfi.c', line 1441
static VALUE r_mpfi_math_sinh (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_sinh(ptr_ret, ptr_a0));
return val_ret;
}
|
.sqr ⇒ Object
mpfi_sqr(ret, p1)
1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 |
# File 'ext/mpfi/ruby_mpfi.c', line 1293
static VALUE r_mpfi_math_sqr (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_sqr(ptr_ret, ptr_a0));
return val_ret;
}
|
.sqrt ⇒ Object
mpfi_sqrt(ret, p1)
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 |
# File 'ext/mpfi/ruby_mpfi.c', line 1305
static VALUE r_mpfi_math_sqrt (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_sqrt(ptr_ret, ptr_a0));
return val_ret;
}
|
.sub ⇒ Object
Subtraction.
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 |
# File 'ext/mpfi/ruby_mpfi.c', line 1203
static VALUE r_mpfi_math_sub (int argc, VALUE *argv, VALUE self)
{
VALUE val_ret;
MPFI *ptr_a0, *ptr_ret;
volatile VALUE tmp_argv0;
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(2, 3, argc, argv));
tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
if (RTEST(rb_funcall(__mpfi_class__, eqq, 1, argv[1]))) {
MPFI *ptr_other;
r_mpfi_get_struct(ptr_other, argv[1]);
r_mpfi_set_function_state(mpfi_sub(ptr_ret, ptr_a0, ptr_other));
} else if (RTEST(rb_funcall(__mpfr_class__, eqq, 1, argv[1]))) {
MPFR *ptr_other;
r_mpfr_get_struct(ptr_other, argv[1]);
r_mpfi_set_function_state(mpfi_sub_fr(ptr_ret, ptr_a0, ptr_other));
} else if (TYPE(argv[1]) == T_FIXNUM) {
r_mpfi_set_function_state(mpfi_sub_si(ptr_ret, ptr_a0, FIX2LONG(argv[1])));
} else if (TYPE(argv[1]) == T_FLOAT) {
r_mpfi_set_function_state(mpfi_sub_d(ptr_ret, ptr_a0, NUM2DBL(argv[1])));
} else {
MPFI *ptr_a2;
volatile VALUE tmp_argv1 = r_mpfi_new_fi_obj(argv[1]);
r_mpfi_get_struct(ptr_a2, tmp_argv1);
r_mpfi_set_function_state(mpfi_sub(ptr_ret, ptr_a0, ptr_a2));
}
return val_ret;
}
|
.tan ⇒ Object
mpfi_tan(ret, p1)
1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 |
# File 'ext/mpfi/ruby_mpfi.c', line 1381
static VALUE r_mpfi_math_tan (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_tan(ptr_ret, ptr_a0));
return val_ret;
}
|
.tanh ⇒ Object
mpfi_tanh(ret, p1)
1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 |
# File 'ext/mpfi/ruby_mpfi.c', line 1453
static VALUE r_mpfi_math_tanh (int argc, VALUE *argv, VALUE self)
{
MPFI *ptr_a0, *ptr_ret;
VALUE val_ret;
volatile VALUE tmp_argv0 = r_mpfi_new_fi_obj(argv[0]);
r_mpfi_get_struct(ptr_a0, tmp_argv0);
r_mpfi_make_struct_init2(val_ret, ptr_ret, r_mpfr_prec_from_optional_argument(1, 2, argc, argv));
r_mpfi_set_function_state(mpfi_tanh(ptr_ret, ptr_a0));
return val_ret;
}
|