高校数学の質問スレ(医者・東大卒専用) Part438 (979レス)
前次1-
抽出解除 必死チェッカー(本家) (べ) 自ID レス栞 あぼーん

276: 2024/10/31(木)13:30 ID:grkcalAP(1/9) AAS
(1) 70÷(-12)の商と余りはいくつか?
(2) (-70)÷(-12)の商と余りはいくつか?

(*
ab2qr=\(a,b){
r1=a%%b
r2=r1-b
r=ifelse(abs(r1)<=abs(r2),r1,r2)
省16
278: 2024/10/31(木)13:43 ID:grkcalAP(2/9) AAS
library(numbers)
Rem=\(a,b){
r=rem(a,b)
c((a-r)/b,r)
}
Rem(70,12)
Rem(-70,12)
省2
279: 2024/10/31(木)13:47 ID:grkcalAP(3/9) AAS
function (n, m)
{
stopifnot(is.numeric(n), is.numeric(m))
if (length(n) == 1) {
n <- rep(n, length(m))
}
else if (length(m) == 1) {
省13
280: 2024/10/31(木)13:53 ID:grkcalAP(4/9) AAS
"
外部リンク[html]:oshiete.goo.ne.jp
5406の7943乗を13でわったときの絶対値最小余剰を教えてください。
"
ab2qr=\(a,b){
r1=a%%b
r2=r1-b
省8
281: 2024/10/31(木)13:54 ID:grkcalAP(5/9) AAS
Wikipediaの記載通り、
絶対的最小剰余とユークリッド除法によって定められる最小非負剰余、
あるいは別の方法のいずれを用いるかは自由であり、与えられる剰余がそのいずれかであるかは予め決められた規約に従う。この規約は、計算する対象や計算機の機種、あるいはプログラミング言語により、まちまちである。

が体験できた。
282: 2024/10/31(木)13:54 ID:grkcalAP(6/9) AAS
QuotientRemainder[70,12]
QuotientRemainder[-70,12]
QuotientRemainder[70,-12]
QuotientRemainder[-70,-12]

RのnumbersとWolframのQuotientRemaiderでは
結果が異なるな。
283
(1): 2024/10/31(木)16:17 ID:grkcalAP(7/9) AAS
Wolfram Language 14.0.0 Engine for Microsoft Windows (64-bit)
Copyright 1988-2023 Wolfram Research, Inc.

In[1]:= Table[QuotientRemainder[10,b],{b,-9,-1}]

Out[1]= {{-2, -8}, {-2, -6}, {-2, -4}, {-2, -2}, {-2, 0}, {-3, -2}, {-4, -2}, {-5, 0}, {-10, 0}}

In[2]:= Table[QuotientRemainder[10,b],{b,1,9}]

Out[2]= {{10, 0}, {5, 0}, {3, 1}, {2, 2}, {2, 0}, {1, 4}, {1, 3}, {1, 2}, {1, 1}}
284: 2024/10/31(木)16:27 ID:grkcalAP(8/9) AAS
>>283
Rに移植
QuotientRemainder=\(a,b){
q=a%/%b
r=a-b*q
data.frame(q=q,r=r)
}
省1
285
(1): 2024/10/31(木)16:35 ID:grkcalAP(9/9) AAS
Wolframの練習問題

練習問題 20^24を1031で割ったときの商と絶対的最小剰余を求めよ。
前次1-
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル

ぬこの手 ぬこTOP 1.531s*