mailman3.inf.ethz.ch
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview
thread

None

None

2 Oct 2026 2 Oct '26
7:03 p.m.

" Note: (-5) DIV 3 = -2 but -5 DIV 3 = -(5 DIV 3) = -1 " The language wants x = (x DIV y) * y + (x MOD y) -Doug Stefan Salewski wrote:

...

Hello,

I think there is something wrong with the DIV statement.

==========

MODULE StSTest;

IMPORT Out;

PROCEDURE Do*; VAR i,j,k:LONGINT; BEGIN Out.String("Output is:"); Out.Ln; i:=10; j:=3; k:=-(-i DIV j); Out.Int(k,8); Out.Ln; i:=-i; k:=-(i DIV j); Out.Int(k,8); Out.Ln; END Do;

BEGIN END StSTest.

StSTest.Do ~

Output is: 3 4 ==========

Best regards

Stefan Salewski -- Oberon@inf.ethz.ch mailing list for ETH Oberon and related systems http://www.lists.inf.ethz.ch/mailman/listinfo/oberon

0 0
Reply
Sign in to reply online Use email software

Back to the thread

Back to the list

HyperKitty Powered by HyperKitty version 1.3.12.