IP() on negative number - issue
11-28-2017, 09:58 PM (This post was last modified: 11-28-2017 09:59 PM by primer.)
Post: #1
 primer Member Posts: 135 Joined: Sep 2015
IP() on negative number - issue
Hello,
I found there is an issue with IP() function (both in home and CAS).
IP() stands for "Integer Part", ok...
but the "integer part" function is defined in math in that way :
It's the function that take a real number and return an integer n with n ≤ x < n+1.

IP(-1.5) returns -1 while the "integer part of -1.5" is -2 according to definition.
so IP() is wrong on negative numbers.

I know FLOOR() does the job, but it's a question of vocabulary.
it's confusing for math users/students.
IP() should return the same as FLOOR().
if you want a function that return -1 here you should use TRUNCATE(-1.5 ,0), not IP(-1.5)

primer
 « Next Oldest | Next Newest »

 Messages In This Thread IP() on negative number - issue - primer - 11-28-2017 09:58 PM RE: IP() on negative number - issue - salvomic - 11-28-2017, 10:12 PM RE: IP() on negative number - issue - toml_12953 - 11-28-2017, 10:42 PM RE: IP() on negative number - issue - cyrille de brébisson - 11-29-2017, 05:57 AM

User(s) browsing this thread: 1 Guest(s)