YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

No floor/ceil/round functions?
Kelvin
#1 Posted : Sunday, January 20, 2019 8:18:03 PM(UTC)
Rank: Advanced Member

Groups: Registered, Moderator
Joined: 3/26/2015(UTC)
Posts: 54
Man
Location: Georgia

Thanks: 3 times
Was thanked: 0 time(s) in 0 post(s)
I swear I remember seeing these mentioned in one of the documentations, but when I tried to use them in my code, the runtime said those functions didn't exist. I mean, it wasn't hard to make bindings for them myself, but I feel like math functions as commonly-used as those should be build in standard.
Sam
#2 Posted : Monday, January 28, 2019 1:40:53 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/18/2018(UTC)
Posts: 1

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
They are included in the standard math library. Make sure you're using the correct syntax.

http://www.squirrel-lang.../sqstdlib3.html#d0e1540

Code:
print( floor(2.3) )
Kelvin
#3 Posted : Wednesday, February 6, 2019 5:43:40 AM(UTC)
Rank: Advanced Member

Groups: Registered, Moderator
Joined: 3/26/2015(UTC)
Posts: 54
Man
Location: Georgia

Thanks: 3 times
Was thanked: 0 time(s) in 0 post(s)
Tried that exact code without floor embedded by myself.

Code:
AN ERROR HAS OCCURED [the index 'floor' does not exist]

CALLSTACK
*FUNCTION [main()] test.nut line [1]

LOCALS
[vargv] ARRAY
[this] TABLE
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.103 seconds.