## ----include = FALSE---------------------------------------------------------- knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ## ----setup-------------------------------------------------------------------- library(discretes) ## ----------------------------------------------------------------------------- identical(0, -0) 1 / 0 1 / -0 ## ----------------------------------------------------------------------------- x <- arithmetic(0, 3, n_left = 1, n_right = 1) x 1 / x 1 / -x ## ----------------------------------------------------------------------------- has_negative_zero(integers()) has_positive_zero(integers()) ## ----------------------------------------------------------------------------- has_negative_zero(-1.5 * integers()) ## ----------------------------------------------------------------------------- x <- dsct_union(-0, 0) x has_positive_zero(x) has_negative_zero(x) ## ----------------------------------------------------------------------------- num_discretes(x) ## ----------------------------------------------------------------------------- 1 / x num_discretes(1 / x)