I think stretch was a pretty good suggestion, actually.

trunc as in “truncate” makes sense for taking 3.14 -> 3 and -2.718 -> -2; 
you quite literally truncate the decimal representation of the number by 
chopping off the decimals. I could imagine the opposite, 3.14 -> 4 and 
-2.718 -> -3, as either “stretching” the numbers to reach all the way to 
the next integer, or “filling” up the remaining distance. Since fill is 
already loaded with quite different meaning, I’d go with stretch.

// T

On Saturday, March 12, 2016 at 2:04:23 PM UTC+1, Dan wrote:

trunc_to_inf and add an alias trunc_to_zero for regular trunc ??
>
> On Saturday, March 12, 2016 at 1:49:41 PM UTC+2, Jeffrey Sarnoff wrote:
>>
>> x = trunc(fp) yields fp rounded towards zero to the closest integer 
>> valued float.
>> What name would you give to the complementary function, rounding away 
>> from zero to the closest integer valued float?
>>
>> stretch(fp)  = signbit(fp) ? floor(fp) : ceil(fp)   # abs(trunc(fp) - 
>> stretch(fp)) is 0.0 when fp is integer valued and is 1.0 otherwise
>>
>>
>>
>> ​

Reply via email to