remquo

Section: C Library Functions (3)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

remquo, remquof, remquol - 商の一部と剰余を求める  

ライブラリ

数学ライブラリ (libm,~-lm)  

書式

#include <math.h>

double remquo(double x, double y, int *quo);
float remquof(float x, float y, int *quo);
long double remquol(long double x, long double y, int *quo);

glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):

remquo(), remquof(), remquol():

    _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
 

説明

これらの関数は x を y で割ったときの商の一部と剰余を計算する。 商のいくつかのビットが quo ポインターを使って格納される。 剰余は関数の結果として返される。

剰余の値は remainder(3) 関数で計算されるものと同じである。

The value stored via the quo pointer has the sign of x~/~y and agrees with the quotient in at least the low order 3 bits.

たとえば remquo(29.0, 3.0) は -1.0 を返し、 (訳注: quo の指しているものには) 2 が格納される。 実際の商が整数値にならない点に注意すること。  

返り値

成功すると、これらの関数は remainder(3) に書かれている同様の関数と同じ値を返す。

x か y が NaN の場合、NaN が返される。

x が無限大で y が NaN でない場合、 領域エラー (domain error) が発生し、NaN が返される。

y がゼロで x が NaN でない場合、 領域エラー (domain error) が発生し、NaN が返される。  

エラー

これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は math_error(7) を参照のこと。

以下のエラーが発生する可能性がある。

Domain error: x is an infinity or y is 0, and the other argument is not a NaN.
不正 (invalid) 浮動小数点例外 (FE_INVALID) が上がる。

これらの関数は errno を設定しない。  

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース属性値
remquo(), remquof(), remquol() Thread safetyMT-Safe
 

標準規格

C11, POSIX.1-2008.  

歴史

glibc 2.1. C99, POSIX.1-2001.  

関連項目

fmod(3), logb(3), remainder(3)


 

Index

名前
ライブラリ
書式
説明
返り値
エラー
属性
標準規格
歴史
関連項目

This document was created by man2html, using the manual pages.