Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How Mob ACC works
#21
FrozNlite Wrote:So truncation is basically specific flooring? Makes sense. I was chopping off the end anyways, which is why I asked the question in the first place.

Not really, but it's okay to think about it in that way in this case because every single number is positive.

Truncating:
1.5 => 1
-1.5 => -1

Flooring:
1.5 => 1
-1.5 => -2

Edit: Woo ninja.
Reply
#22
Fiel Wrote:Another way to think of "floor" would be to round down. Always round down.

This is different from typecasting "int", though. "int" rounds toward zero whereas floor rounds down. That makes truncation different for values below zero. For the purposes of this calculation, though, floor and typecasting int do the same thing.

That depends on your language, in Python 2.6.5, int(-1.5) will give you -1 (tried just now).
Reply
#23
kirayamato26 Wrote:That depends on your language, in Python 2.6.5, int(-1.5) will give you -1 (tried just now).

I did say that...?

Fiel Wrote:Another way to think of "floor" would be to round down. Always round down.

This is different from typecasting "int", though. "int" rounds toward zero whereas floor rounds down. That makes truncation different for values below zero. For the purposes of this calculation, though, floor and typecasting int do the same thing.

And also consider that I am a python programmer. hahaha
Reply
#24
Fiel Wrote:I did say that...?



And also consider that I am a python programmer. hahaha

Ah, my bad, I read it backwards, sorry. X_X
Off topic, but is there any advantage to using Python 3 over Python 2?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)