phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hancock <jhancock1...@gmail.com>
Subject Re: can I prevent rounding of a/b when a and b are integers
Date Thu, 22 Sep 2016 09:56:29 GMT
I think it is fairly standard in programming languages for / to mean
integer division when the operands used are integers.  Therefore 1/3=0 is
not a surprising result to me; other programming languages I have worked in
give 1/3=0.  However if one of the operands to / is a decimal, the result
is also decimal, so 1.0/3 = 0.333... I don't think the behavior of / is
incorrect as is.

On Thu, Sep 22, 2016 at 4:45 AM, Heather, James (ELS-LON) <
james.heather@elsevier.com> wrote:

>
>
> On Thu, 2016-09-22 at 05:39 +0000, Bulvik, Noam wrote:
>
> We have an app that let user write their own SQL
>
>
> Um, do they write DROP TABLE statements in there?
>
> ------------------------------
>
> Elsevier Limited. Registered Office: The Boulevard, Langford Lane,
> Kidlington, Oxford, OX5 1GB, United Kingdom, Registration No. 1982084,
> Registered in England and Wales.
>

Mime
View raw message