How can I add .01 to Compare at Price to prevent sale badge display?

I keep running into errors when I try and add .01 to price so that the sale badge does not show up if the prices are $0.01 difference:

assign on_sale = false
if product.compare_at_price > product.price
assign on_sale = true
endif

Can I not just add plus: 0.01 to product.compare_at_price? Can someone please help with the language?

{%- liquid 

  assign on_sale = false
  
  if product.compare_at_price != null
    assign difference = product.price | minus: product.compare_at_price | round : 2
    
    if difference > 0.01
      assign on_sale = true
    endif
  endif
  
-%}