Math function Floor()

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Contact:

Math function Floor()

Post by trenatos » Tue Feb 11, 2014 7:52 am

Is floor() available in LC?

I've tried to find out but haven't been able to find it, figured I should ask before giving up.
Marcus

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Math function Floor()

Post by Thierry » Tue Feb 11, 2014 8:06 am

trenatos wrote:Is floor() available in LC?
what about trunc() ?

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Contact:

Re: Math function Floor()

Post by trenatos » Tue Feb 11, 2014 8:13 am

Doesn't trunc always round towards 0 though?
Marcus

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Math function Floor()

Post by Thierry » Tue Feb 11, 2014 8:22 am

trenatos wrote:Doesn't trunc always round towards 0 though?
Yes, you are right...
early morning, lack of coffee.. :?
I just test round() and seems to be what you like or do I miss something?

Regards,

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Contact:

Re: Math function Floor()

Post by trenatos » Tue Feb 11, 2014 11:30 am

Round rounds to nearest whole number, floor() rounds to nearest *lower* whole number.

It's not that big of a deal, just strange to be missing, I'll just create the function for now and hope that RunRev builds floor() into future releases of LC.
Marcus

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Math function Floor()

Post by Thierry » Tue Feb 11, 2014 2:03 pm

trenatos wrote:.... and hope that RunRev builds floor() into future releases of LC.
may be worth asking this in the "Feature requests" forum?

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Math function Floor()

Post by FourthWorld » Tue Feb 11, 2014 4:06 pm

It's common enough in other languages that it may be ideal to just submit the request directly to the LCQCC so it can be tracked:
http://quality.runrev.com/

Please include ceiling with that as well, since the two are commonly found together. Thanks.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Contact:

Re: Math function Floor()

Post by trenatos » Wed Feb 12, 2014 2:44 am

Are you suggesting I add it as a "bug"?

And, I'm not going anywhere near the "Feature request" forum anytime soon.

-edit-

Made an account and found that I could post an Enhancement suggestion.
Marcus

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Math function Floor()

Post by FourthWorld » Wed Feb 12, 2014 3:14 am

trenatos wrote:Are you suggesting I add it as a "bug"?
The Quality Control Center form allows you to designate whether a report is a bug or a feature request.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply