Yoko

All sides of Injection
It is currently 2025-12-25 18:53:56

All times are UTC+02:00




Post new topic  Reply to topic  [ 9 posts ] 
Author Message
PostPosted: 2006-04-09 16:48:56 
Offline
Expert!
User avatar

Joined: 2006-02-25 21:48:38
Posts: 1032
Вопрос простой: как в инжекте взять модуль от числа?
Что-то вроде:
Code:
abs(x)


Last edited by DerMeister =) on 2006-04-09 16:53:08, edited 2 times in total.

Top
   
PostPosted: 2006-04-09 16:50:24 
Offline
Expert!
User avatar

Joined: 2006-02-07 08:51:40
Posts: 1348
Location: г. Старый Оскол
Der wrote:
Вопрос простой: как в инжекте взять модуть он числа?
Что то вроде:
Code:
abs(x)


Кому что... А нах тебе это?


Top
   
 Post subject:
PostPosted: 2006-04-09 16:52:16 
Offline
Expert!
User avatar

Joined: 2006-02-25 21:48:38
Posts: 1032
Для этого:

Code:
...
if abs(myx-xx[i]) > 2 or abs(myy-yy[i]) > 2 then
GoToXY(xx[i],yy[i],1)
end if
...


Top
   
 Post subject:
PostPosted: 2006-04-09 17:00:17 
Offline
Expert!
User avatar

Joined: 2006-02-25 21:48:38
Posts: 1032
Конечно можно так, но ет неприкольно:

Code:
...
if (myx-xx[i]) > 2 or (myy-yy[i]) > 2 or (myx-xx[i]) < -2 or (myy-yy[i]) < -2 then
GoToXY(xx[i],yy[i],1)
end if
...


Top
   
 Post subject:
PostPosted: 2006-04-09 17:01:56 
Offline
Expert!
User avatar

Joined: 2006-02-07 08:51:40
Posts: 1348
Location: г. Старый Оскол
Der wrote:
Конечно можно так, но ет неприкольно:

Code:
...
if (myx-xx[i]) > 2 or (myy-yy[i]) > 2 or (myx-xx[i]) < -2 or (myy-yy[i]) < -2 then
GoToXY(xx[i],yy[i],1)
end if
...


Скорее всего так и придется...


Top
   
 Post subject:
PostPosted: 2006-04-09 17:11:00 
Offline

Joined: 2006-02-03 06:53:36
Posts: 64
Напиши свою функцию
Code:
sub abs(x)
    if (x < 0) then
        x = -x
    end if
    return x
end sub


Top
   
 Post subject:
PostPosted: 2006-04-09 17:26:16 
Offline
Expert!
User avatar

Joined: 2006-02-25 21:48:38
Posts: 1032
Чтоже получается? В инже НЕТУ операции "абсолютного значения"?
Это абсурд... Наверное есть, надо чтоб Yoko рассказал.

А про
Code:
sub abs(x) 
    if (x < 0) then
        x = -x
    end if
    return x
end sub


я также подумал... :)


Top
   
 Post subject:
PostPosted: 2006-04-09 17:33:40 
Offline

Joined: 2006-02-03 06:53:36
Posts: 64
встроенной нету. из мат. функций есть тока sin и cos. посмотри почти любую ходилку - там везе своя ф-я Abs(...)


Top
   
 Post subject:
PostPosted: 2006-04-09 17:42:27 
Offline
Expert!
User avatar

Joined: 2006-02-25 21:48:38
Posts: 1032
А жаль что нету... %(

Насчет sin и cos не знал, спасибо.

Кстате, в моей ходилке abs'a нету...


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 5 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:  
Powered by phpBB® Forum Software © phpBB Limited