HP3000-L Archives

April 1998, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Roy Brown <[log in to unmask]>
Reply To:
Roy Brown <[log in to unmask]>
Date:
Thu, 16 Apr 1998 18:31:34 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
In article <[log in to unmask]>, [log in to unmask] writes
>I have an old HP85 Basic program with the following command;
>
>IF NUM1 DIV NUM2 MOD M=0 THEN GOSUB 9000
>
>I am trying to get this program to run in QBASIC/GWBASIC.  I am familiar with
>the MOD , but not the DIV.  If someone out there has an old manual for HP
>Basic or if this DIV command is still part of current HP Basic, I would
>appreciate the information on syntax and usage.
>
>TIA

I would guess Integer Division - '\' in QBASIC, rather than '/', which
is floating point division.

Looking at the example for 'MOD' in QuickBasic (not QBASIC) Help, it
looks very similar.

The QBASIC Help, which is different, says that the expression on each
side of MOD is rounded to integer before use, if a real number.

So  5 \ 2 MOD 2=0 will be true  (5 \ 2 gives 2)
but 5 / 2 MOD 2=0 will be false
                  (5 / 2 gives 2.5 which will round to 3 in the MOD).

Are you really sure, though, of the HP85 Basic 'MOD'? I wonder if it
does this rounding?
--
Roy Brown               Phone : (01684) 291710     Fax : (01684) 291712
Affirm Ltd              Email : [log in to unmask]
The Great Barn, Mill St 'Have nothing on your systems that you do not
TEWKESBURY GL20 5SB (UK) know to be useful, or believe to be beautiful.'

ATOM RSS1 RSS2