Don Wrote: > BTW, does Python allow integer division of floating point numbers? > eg, int_a = float_b // float_c; ? > (meaning cast(int)float_b / (cast(int)float_c); ). Python doesn't have integer division, but floor division, and it's perefctly valid if arguments are floats, as name says it's just floor of true division, also python define modulo on floats, so expression a//b * b + a%b == a is always true for builtin numerc types (except if at least one of arguments being inf, NaN, or b = 0)
- Re: Detecting inadvertent use o... bearophile
- Re: Detecting inadvertent u... Bob Jones
- Re: Detecting inadvertent use o... Don
- Re: Detecting inadvertent u... Bob Jones
- Re: Detecting inadvertent u... Don
- Re: Detecting inadvertent u... bearophile
- Re: Detecting inadvertent u... KennyTM~
- Re: Detecting inadvertent u... Nick Sabalausky
- Re: Detecting inadvertent u... bearophile
- Re: Detecting inadvertent u... Leandro Lucarella
- Re: Detecting inadvertent use of int... Peter
- Re: Detecting inadvertent use of integer division Saaa
- Re: Detecting inadvertent use of integer division Phil Deets
- Re: Detecting inadvertent use of integer division Jason House
- Re: Detecting inadvertent use of integer divisio... Don
- Re: Detecting inadvertent use of integer div... Lars T. Kyllingstad
- Re: Detecting inadvertent use of integer... Don
- Re: Detecting inadvertent use of int... Andrei Alexandrescu
