Division operators

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Division operators

Postby Charles » Fri Mar 05, 2010 9:58 pm

In Cobra, a single slash (/) gives a fractional value, while a double slash (//) gives you integer division:
class Div

def main
assert 5 / 4 == 1.25
assert 5 // 4 == 1
Posts: 2514
Location: Los Angeles, CA

Return to Discussion

Who is online

Users browsing this forum: No registered users and 5 guests