Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): John Whish / John Whish (John Whish)
Created: 08/27/2015
Components: Language
Versions: 11.0
Failure Type: Enhancement Request
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Minor / Unknown
Locale/System: English / Mac 10.9 64 bit
Vote Count: 8
Suggested language improvement:
The `int` function implies by it's name that it returns the integer part of a decimal. It would be better to rename it as `floor` which is common in other languages. For example:
<cfscript>
n = 37.3;
writeDump([
int(n), // 37
int(0-n), // -38
fix(n), // 37
fix(0-n), // -37
round(n), // 37
round(0-n) // -37
]);
</cfscript>
In this example you can see that `int(-37.3)` returns -38. If the function was called floor in would be much clearer what the intent of the function is. As we already have ceiling this seems like a sensible move.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4044533
External Customer Info:
External Company:
External Customer Name: John Whish
External Customer Email:
Attachments:
Comments: