tag mismatch with the usage of acos and asin
#1

Hello
I was using the functions acos and asin in something:
pawn Код:
GivePlayerMoney(playerid,X(acos(X)-asin(X)-X)-2);
GivePlayerMoney(playerid,X(acos(X)-asin(X)-X)-2);
But I get those warnings while compiling:
pawn Код:
warning 213: tag mismatch
warning 213: tag mismatch
Can someone help me?
Reply
#2

How's X defined? What tag you assigned to it?
Reply
#3

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
How's X defined? What tag you assigned to it?
pawn Код:
new X =random(GetPlayerMoney(ID));
Reply
#4

acos and asin need the Float: tag.

Also, GivePlayerMoney doesn't support float numbers.
Reply
#5

I was messing with your formula a little bit, and asin and acos, no matter how they're used within the formula, will cause everything to return 0.....

example:
pawn Код:
printf("%f",asin(500));
returns 0;
pawn Код:
printf("%f",asin(500)+500);
returns 0;
pawn Код:
printf("%f",500);
returns 500;

EDIT: Just realized that acos/asin can only have a number between -1 and 1, lol
Reply
#6

Quote:
Originally Posted by SilentHuntR
Посмотреть сообщение
I was messing with your formula a little bit, and asin and acos, no matter how they're used within the formula, will cause everything to return 0.....

example:
pawn Код:
printf("%f",asin(500));
returns 0;
pawn Код:
printf("%f",asin(500)+500);
returns 0;
pawn Код:
printf("%f",500);
returns 500;

EDIT: Just realized that acos/asin can only have a number between -1 and 1, lol
False!

Код:
printf("asin: %d acos: %d",asin(Float:46), acos(Float:46));
printf("asin: %f acos: %f",asin(Float:46), acos(Float:46));
result

Код:
asin: 2636 acos: 1119092735
asin: 0.000000 acos: 89.999992
Never been into these acos asin stuff, i hate mathematics!
Reply
#7

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
acos and asin need the Float: tag.

Also, GivePlayerMoney doesn't support float numbers.
So how can I make it support floats?

Quote:
Originally Posted by SilentHuntR
Посмотреть сообщение
I was messing with your formula a little bit, and asin and acos, no matter how they're used within the formula, will cause everything to return 0.....

example:
pawn Код:
printf("%f",asin(500));
returns 0;
pawn Код:
printf("%f",asin(500)+500);
returns 0;
pawn Код:
printf("%f",500);
returns 500;

EDIT: Just realized that acos/asin can only have a number between -1 and 1, lol
Where are you getting to?
Reply
#8

You can't, maybe there is a way around this of what you try to do ?
Reply
#9

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
False!

Код:
printf("asin: %d acos: %d",asin(Float:46), acos(Float:46));
printf("asin: %f acos: %f",asin(Float:46), acos(Float:46));
result

Код:
asin: 2636 acos: 1119092735
asin: 0.000000 acos: 89.999992
Never been into these acos asin stuff, i hate mathematics!
Try changing your acos number to anything above 1, it comes out with the same result everytime...
Reply
#10

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
You can't, maybe there is a way around this of what you try to do ?
I've tried doing stocks and another arguments,but it only gives me more errors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)