SMPTE / st428-1

Other
1 stars 0 forks source link

Definition of INT operator isn't clear and the choice of name needs fixing #7

Open radford-for-smpte opened 4 years ago

radford-for-smpte commented 4 years ago

The current definition doesn't make it clear that the returned value is an integer. Additionally, INT() is not the correct name for a function that performs rounding (and thus conflicts with the ISO definition of int()).

Suggest to:

  1. rename INT() to ROUND()
  2. use a proper definition. E.g.:

The ROUND( ) function returns the nearest integer value of its argument. If decimal value is from ”.1 to .5″, it returns integer value less than the argument. If decimal value is from “.6 to .9″, it returns the integer value greater than the argument.

palemieux commented 4 years ago

I suggest:

round(x) = floor(0.5 + x)

radford-for-smpte commented 4 years ago

I suggest:

round(x) = floor(0.5 + x)

Yep that'd be great, would we need to define floor() then as well?

palemieux commented 4 years ago

Yep that'd be great, would we need to define floor() then as well?

Probably, unless we refer to ISO definitions.

floor(x) returns the the greatest integer less than or equal to x, maybe?