Yoko

All sides of Injection
It is currently 2025-11-30 08:52:19

All times are UTC+02:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 2004-08-24 01:59:48 
Offline

Joined: 2004-04-26 00:36:26
Posts: 45
Есть ли функция которая возвращяет остаток ?


Top
   
 Post subject:
PostPosted: 2004-08-24 15:11:19 
Offline

Joined: 2004-07-28 12:39:29
Posts: 22
Code:
sub mod(a,b)
var r = a
  while r >= b
    r = r - b
  wend
  return r
end sub
sub div(a,b)
var r = a
var i = 0
  while r >= b
    r = r - b
    i = i + 1
  wend
  return i
end sub


Top
   
 Post subject:
PostPosted: 2004-08-24 17:15:03 
Offline
Expert!

Joined: 2004-04-03 17:36:29
Posts: 2544
Location: Saint-Petersburg
333333 wrote:
Code:
sub mod(a,b)
var r = a
  while r >= b
    r = r - b
  wend
  return r
end sub
sub div(a,b)
var r = a
var i = 0
  while r >= b
    r = r - b
    i = i + 1
  wend
  return i
end sub


Я лично не понял зачем тут вводятся переменные 'r', а переменная 'a' не используется... :shock:


Top
   
 Post subject:
PostPosted: 2004-08-24 18:38:49 
Offline

Joined: 2004-04-26 00:36:26
Posts: 45
Все спасиба! +)


Top
   
 Post subject:
PostPosted: 2004-08-29 15:54:19 
Offline

Joined: 2004-07-28 12:39:29
Posts: 22
Edred wrote:
Я лично не понял зачем тут вводятся переменные 'r', а переменная 'a' не используется... :shock:

Мало ли что случится с а :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited