Python Forum
Integer Operator in If Statements
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Integer Operator in If Statements
#14
(Feb-25-2017, 11:51 PM)warmth Wrote: I meant to say, is division the only operation which results in a float, and im guessing its like that because of the '//' operation, which will always result in an int.

I think you don't understand fully the difference between classic (python2.x), true (python 3.x and also the common math division) and floor division (as described in PEP 238). The type of the result will depend on type of dividend and divisor and which python version you use:

Python 2.x

Python3.x:
Reply


Messages In This Thread
Integer Operator in If Statements - by warmth - Feb-25-2017, 03:55 AM
RE: Integer Operator in If Statements - by Larz60+ - Feb-25-2017, 04:18 AM
RE: Integer Operator in If Statements - by Skaperen - Feb-25-2017, 07:07 AM
RE: Integer Operator in If Statements - by buran - Feb-25-2017, 07:30 AM
RE: Integer Operator in If Statements - by warmth - Feb-25-2017, 04:10 PM
RE: Integer Operator in If Statements - by zivoni - Feb-25-2017, 09:15 PM
RE: Integer Operator in If Statements - by wavic - Feb-25-2017, 03:29 PM
RE: Integer Operator in If Statements - by wavic - Feb-25-2017, 04:19 PM
RE: Integer Operator in If Statements - by buran - Feb-25-2017, 05:44 PM
RE: Integer Operator in If Statements - by warmth - Feb-25-2017, 11:51 PM
RE: Integer Operator in If Statements - by Skaperen - Feb-26-2017, 03:19 AM
RE: Integer Operator in If Statements - by buran - Feb-26-2017, 08:59 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020