Jump to content

Python operator equivalents


ShadowMage

Recommended Posts

For starters, does anybody know the difference between Python's / and // operators? What would be the PHP equivalents to those operators? From my understanding of this page:Python's / operator is the same as PHP's / operator.

x / y = x / y

Python's // operator is the same as using the floor function on the result of the / operation in PHP.

x // y = floor(x/y)

Can anyone confirm this? Or am I way off?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...