Skip to content

floor not working for few values in round_any()  #291

@herambgadgil

Description

@herambgadgil

Greetings,

I am using round_any() function in one of my projects and few values are getting incorrectly floored.

test_var <- unlist(
                     lapply(
                         seq(1000, 10000, 10), function(x) plyr::round_any(x / 1000, accuracy = 0.01, f = floor)
                               )
                      )

check_var <- test_var[duplicated(test_var)] 

test_df <- data.frame(Original_Ser = seq(1000, 10000, 10), Trunc2Deci_Result = test_var, 
                                   Dups_Tag = duplicated(test_var)
                                  )

Ideally there should not be any duplicates as I am increasing the input by 10. But I am getting 76 duplicates. I did not observe any pattern for these duplicates.

Thanks!
Heramb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions