From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-28-2022 01:34 AM
こんにちは。LABVIEW初心者のcsti22042です。ご質問失礼いたします。以下の問題を解いておりますが、正しく商と余りが表示されず、困惑しております。
X<0及びY>0の時、X/Yの商と剰余を計算する。
(i) |X|>Yの時
(ii)|X|<Yの時
(i)のパターンはうまく計算できますが、(ii)の時は商と剰余が正しい結果になりません。スクリーンショットを見ていただければわかると思いますが、ここでは商が0、余りが3になるはずです。
恐れ入りますが、ご教授いただければ幸いです。よろしくお願いいたします。
09-28-2022 01:00 PM
-2/3 gives you Q=-1 and R=1, it is correct.
You are getting back X when you verify the results using,
X = Q*Y + R
R is always >=0
Please refer to this article - https://people.ohio.edu/melkonia/math3050/HW/Section4.4.pdf
10-10-2022 09:15 PM
Thank you for your reply. Sorry for the late reply.
n div d = q and n mod d = r ⇔ n = dq + r
I understand the article about the formula above. I would like to create it in LabVIEW even if q is 0, but is it currently impossible?
10-10-2022 10:19 PM
@csti22042 wrote:
Thank you for your reply. Sorry for the late reply.
n div d = q and n mod d = r ⇔ n = dq + r
I understand the article about the formula above. I would like to create it in LabVIEW even if q is 0, but is it currently impossible?
q=0 case is always possible and that is how LabVIEW also works. The important condition is that r>=0