(42S) Quotient and Remainder

04052023, 03:55 PM
(This post was last modified: 04052023 04:52 PM by Werner.)
Post: #5




RE: (42S) Quotient and Remainder
So, to work for negative X and/or Y, the algorithm should become:
(changes in red) t := X/Y; Q := FLOOR(t); R := MOD(Y,X); if t#Q then return(R,Q); t := X  R; if ABS(t)<ABS(R) then Q:= Q  1; if t=R then Q:= Q  MOD(FLOOR(MOD(Y,X*10)/X),2); /* equals IP(MOD(MOD(Y,X*10)/X,2)) */ return(R,Q); Sigh. Back to the drawing board.[update: done] Werner 41CVâ€ ,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE 

« Next Oldest  Next Newest »

Messages In This Thread 
(42S) Quotient and Remainder  Werner  04052023, 09:38 AM
RE: (42S) Quotient and Remainder  Albert Chan  04052023, 12:39 PM
RE: (42S) Quotient and Remainder  Werner  04052023, 01:11 PM
RE: (42S) Quotient and Remainder  Albert Chan  04052023, 01:48 PM
RE: (42S) Quotient and Remainder  Werner  04052023 03:55 PM
RE: (42S) Quotient and Remainder  Albert Chan  04062023, 12:03 AM
RE: (42S) Quotient and Remainder  Albert Chan  04062023, 02:55 PM

User(s) browsing this thread: 1 Guest(s)