Skip to content

Commit 150f904

Browse files
committed
Fix unsafe floating point comparison
1 parent b750ed3 commit 150f904

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared-bindings/analogio/AnalogIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ STATIC mp_obj_t analogio_analogin_obj_get_reference_voltage(mp_obj_t self_in) {
140140
check_for_deinit(self);
141141

142142
float reference_voltage = common_hal_analogio_analogin_get_reference_voltage(self);
143-
if (reference_voltage == 0.0f) {
143+
if (reference_voltage <= 0.0f) {
144144
return mp_const_none;
145145
} else {
146146
return mp_obj_new_float(reference_voltage);

0 commit comments

Comments
 (0)