Raised This Month: $ Target: $400
 0% 

[ANY] cannot find sqrt and pow functions! [SOLVED]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
D.Moder
I uploaded 2 great gameplay plugins here
Join Date: Sep 2009
Location: Sin city
Old 04-10-2015 , 19:28   [ANY] cannot find sqrt and pow functions! [SOLVED]
Reply With Quote #1

does sourcepawn have square root and power functions ??
I looked through all include files, I don't see them?!!
__________________
Creator of COD-Life (Half COD, Half Life)
https://forums.alliedmods.net/showthread.php?t=261162
twitter: @D_Moder_61216

Last edited by D.Moder; 04-10-2015 at 19:55.
D.Moder is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 04-10-2015 , 19:32   Re: [ANY] cannot find sqrt and pow functions!
Reply With Quote #2

SquareRoot and Pow...? they're in float.inc
Miu is offline
D.Moder
I uploaded 2 great gameplay plugins here
Join Date: Sep 2009
Location: Sin city
Old 04-10-2015 , 19:37   Re: [ANY] cannot find sqrt and pow functions!
Reply With Quote #3

oh, ok, so there is no int version of that?


I found
PHP Code:
Float:pow(Float:valueFloat:exponent
so I have to
PHP Code:
RoundToFloor(Pow(float(x),float(y))) 
to get the int version ??
__________________
Creator of COD-Life (Half COD, Half Life)
https://forums.alliedmods.net/showthread.php?t=261162
twitter: @D_Moder_61216

Last edited by D.Moder; 04-10-2015 at 19:38.
D.Moder is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 04-10-2015 , 19:41   Re: [ANY] cannot find sqrt and pow functions!
Reply With Quote #4

yes
__________________
WildCard65 is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 04-10-2015 , 19:43   Re: [ANY] cannot find sqrt and pow functions!
Reply With Quote #5

don't think i've ever even seen a language with int sqrt and pow functions in its standard library
Miu is offline
D.Moder
I uploaded 2 great gameplay plugins here
Join Date: Sep 2009
Location: Sin city
Old 04-10-2015 , 19:53   Re: [ANY] cannot find sqrt and pow functions!
Reply With Quote #6

Quote:
Originally Posted by Miu View Post
don't think i've ever even seen a language with int sqrt and pow functions in its standard library
in sourcemod we don't have doubles, so this is a different case ok?

and here is what I came up with, in case anyone needed it.
PHP Code:
stock iPow(valueexponent)
{
    return 
RoundToFloor(Pow(float(value), float(exponent)));

__________________
Creator of COD-Life (Half COD, Half Life)
https://forums.alliedmods.net/showthread.php?t=261162
twitter: @D_Moder_61216
D.Moder is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 04-10-2015 , 20:48   Re: [ANY] cannot find sqrt and pow functions!
Reply With Quote #7

Quote:
Originally Posted by D.Moder View Post
in sourcemod we don't have doubles, so this is a different case ok?
:D
Miu is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode